diff --git a/src/app/auth/components/user.tsx b/src/app/auth/components/user.tsx index de47bff0..b95b52f3 100644 --- a/src/app/auth/components/user.tsx +++ b/src/app/auth/components/user.tsx @@ -10,8 +10,8 @@ export function User({ pubkey }: { pubkey: string }) { return (
-
- +
+
diff --git a/src/app/auth/pages/import/step-2/index.page.tsx b/src/app/auth/pages/import/step-2/index.page.tsx index 0f3fc071..588c497f 100644 --- a/src/app/auth/pages/import/step-2/index.page.tsx +++ b/src/app/auth/pages/import/step-2/index.page.tsx @@ -1,4 +1,5 @@ import { User } from "@app/auth/components/user"; +import { Button } from "@shared/button"; import { LoaderIcon } from "@shared/icons"; import { RelayContext } from "@shared/relayProvider"; import { useActiveAccount } from "@stores/accounts"; @@ -47,7 +48,7 @@ export function Page() { {loading ? "Creating..." : "Continue with"}
-
+
{!account ? (
@@ -61,17 +62,13 @@ export function Page() { ) : (
- +
)}
diff --git a/src/app/onboarding/pages/index.page.tsx b/src/app/onboarding/pages/index.page.tsx index dc48a1bc..5269a13e 100644 --- a/src/app/onboarding/pages/index.page.tsx +++ b/src/app/onboarding/pages/index.page.tsx @@ -1,5 +1,6 @@ import { NDKEvent, NDKPrivateKeySigner } from "@nostr-dev-kit/ndk"; import { ArrowRightCircleIcon } from "@shared/icons/arrowRightCircle"; +import { Link } from "@shared/link"; import { RelayContext } from "@shared/relayProvider"; import { User } from "@shared/user"; import { useActiveAccount } from "@stores/accounts"; @@ -95,12 +96,12 @@ export function Page() { Publish - Skip for now - +
diff --git a/src/shared/accounts/active.tsx b/src/shared/accounts/active.tsx index 5f3c5cae..bdaa79e0 100644 --- a/src/shared/accounts/active.tsx +++ b/src/shared/accounts/active.tsx @@ -1,4 +1,5 @@ import { Image } from "@shared/image"; +import { NetworkStatusIndicator } from "@shared/networkStatusIndicator"; import { RelayContext } from "@shared/relayProvider"; import { useActiveAccount } from "@stores/accounts"; import { useChannels } from "@stores/channels"; @@ -64,12 +65,13 @@ export function ActiveAccount({ data }: { data: any }) { }); return ( - ); } diff --git a/src/shared/accounts/inactive.tsx b/src/shared/accounts/inactive.tsx index 7ea9a751..02d069d9 100644 --- a/src/shared/accounts/inactive.tsx +++ b/src/shared/accounts/inactive.tsx @@ -1,5 +1,4 @@ import { Image } from "@shared/image"; - import { DEFAULT_AVATAR } from "@stores/constants"; import { useProfile } from "@utils/hooks/useProfile"; @@ -7,11 +6,11 @@ export function InactiveAccount({ data }: { data: any }) { const { user } = useProfile(data.npub); return ( -
+
{data.npub}
); diff --git a/src/shared/appHeader.tsx b/src/shared/appHeader.tsx index 3e745a3d..40c8858f 100644 --- a/src/shared/appHeader.tsx +++ b/src/shared/appHeader.tsx @@ -1,17 +1,6 @@ import { ArrowLeftIcon, ArrowRightIcon } from "@shared/icons"; -import useSWR from "swr"; - -const fetcher = async () => { - const { platform } = await import("@tauri-apps/api/os"); - return platform(); -}; - -export function AppHeader() { - const { data: platform } = useSWR( - typeof window !== "undefined" ? "platform" : null, - fetcher, - ); +export function AppHeader({ reverse }: { reverse?: boolean }) { const goBack = () => { window.history.back(); }; @@ -23,8 +12,8 @@ export function AppHeader() { return (
diff --git a/src/shared/image.tsx b/src/shared/image.tsx index d3d0475d..7e1c74f5 100644 --- a/src/shared/image.tsx +++ b/src/shared/image.tsx @@ -1,14 +1,8 @@ import { DEFAULT_AVATAR } from "@stores/constants"; -import { ClassAttributes, ImgHTMLAttributes, JSX } from "react"; -export function Image( - props: JSX.IntrinsicAttributes & - ClassAttributes & - ImgHTMLAttributes, - fallback = undefined, -) { +export function Image(props, fallback?) { const addImageFallback = (event: { currentTarget: { src: string } }) => { - event.currentTarget.src = fallback ? fallback : DEFAULT_AVATAR; + event.currentTarget.src = fallback || DEFAULT_AVATAR; }; return ( diff --git a/src/shared/layout.tsx b/src/shared/layout.tsx index 404f273d..c2d1c687 100644 --- a/src/shared/layout.tsx +++ b/src/shared/layout.tsx @@ -19,7 +19,7 @@ export function DefaultLayout({ children }: { children: React.ReactNode }) { }`} >
- +
{children}
diff --git a/src/shared/multiAccounts.tsx b/src/shared/multiAccounts.tsx index 19d01256..20a651fe 100644 --- a/src/shared/multiAccounts.tsx +++ b/src/shared/multiAccounts.tsx @@ -2,7 +2,6 @@ import { getAccounts, getActiveAccount } from "@libs/storage"; import { ActiveAccount } from "@shared/accounts/active"; import { InactiveAccount } from "@shared/accounts/inactive"; import { BellIcon, PlusIcon } from "@shared/icons"; -import { APP_VERSION } from "@stores/constants"; import useSWR from "swr"; const allFetcher = () => getAccounts(); @@ -13,62 +12,29 @@ export function MultiAccounts() { const { data: activeAccount }: any = useSWR("activeAccount", fetcher); return ( -
-
-
- <> - {!activeAccount ? ( -
- ) : ( - - )} - -
- -
-
-
-
- <> - {!accounts ? ( -
- ) : ( - accounts.map( - (account: { is_active: number; pubkey: string }) => ( - - ), - ) - )} - - -
-
-
- - Lume - - - v{APP_VERSION} - -
+
+ {!activeAccount ? ( +
+ ) : ( + + )} + {!accounts ? ( +
+ ) : ( + accounts.map((account: { is_active: number; pubkey: string }) => ( + + )) + )} +
); } diff --git a/src/shared/navigation.tsx b/src/shared/navigation.tsx index 8ea5d8ef..09040bfc 100644 --- a/src/shared/navigation.tsx +++ b/src/shared/navigation.tsx @@ -5,15 +5,17 @@ import { ActiveLink } from "@shared/activeLink"; import { AppHeader } from "@shared/appHeader"; import { Composer } from "@shared/composer/modal"; import { NavArrowDownIcon, SpaceIcon, TrendingIcon } from "@shared/icons"; -import { useComposer } from "@stores/composer"; - -export function Navigation() { - const toggle = useComposer((state: any) => state.toggleModal); +import { MultiAccounts } from "@shared/multiAccounts"; +export function Navigation({ reverse }: { reverse?: boolean }) { return ( -
- -
+
+ +
@@ -104,6 +106,9 @@ export function Navigation() { )}
+
+ +
); } diff --git a/src/shared/networkStatusIndicator.tsx b/src/shared/networkStatusIndicator.tsx index fdb56fb0..2b538bd2 100644 --- a/src/shared/networkStatusIndicator.tsx +++ b/src/shared/networkStatusIndicator.tsx @@ -4,22 +4,10 @@ export function NetworkStatusIndicator() { const isOnline = useNetworkStatus(); return ( -
-
- - -
-

- {isOnline ? "Online" : "Offline"} -

-
+ ); } diff --git a/src/shared/notes/mentions/user.tsx b/src/shared/notes/mentions/user.tsx index 39875ea6..a8752afa 100644 --- a/src/shared/notes/mentions/user.tsx +++ b/src/shared/notes/mentions/user.tsx @@ -7,7 +7,7 @@ export function MentionUser({ pubkey }: { pubkey: string }) { return ( @{user?.name || user?.displayName || shortenKey(pubkey)} diff --git a/src/shared/notes/preview/link.tsx b/src/shared/notes/preview/link.tsx index 87532ab6..7f1776e6 100644 --- a/src/shared/notes/preview/link.tsx +++ b/src/shared/notes/preview/link.tsx @@ -29,6 +29,7 @@ export function LinkPreview({ urls }: { urls: string[] }) { src={data["og:image"]} alt={urls[0]} className="w-full h-44 object-cover rounded-t-lg bg-white" + fallback="https://void.cat/d/XTmrMkpid8DGLjv1AzdvcW" /> )}
diff --git a/src/shared/user.tsx b/src/shared/user.tsx index f22e1b62..171ef8a9 100644 --- a/src/shared/user.tsx +++ b/src/shared/user.tsx @@ -73,6 +73,7 @@ export function User({ src={user?.image || DEFAULT_AVATAR} alt={pubkey} className="h-11 w-11 shrink-0 rounded-lg object-cover" + fallback={DEFAULT_AVATAR} />