diff --git a/apps/desktop/src/routes/auth/create.tsx b/apps/desktop/src/routes/auth/create.tsx index 6b6ef649..ae3508eb 100644 --- a/apps/desktop/src/routes/auth/create.tsx +++ b/apps/desktop/src/routes/auth/create.tsx @@ -147,6 +147,10 @@ export function CreateAccountScreen() { ark.updateNostrSigner({ signer: remoteSigner }); + // remove default nsecbunker profile and contact list + await ark.createEvent({ kind: NDKKind.Metadata, content: "", tags: [] }); + await ark.createEvent({ kind: NDKKind.Contacts, content: "", tags: [] }); + setOnboarding(true); setIsLoading(false); @@ -163,8 +167,8 @@ export function CreateAccountScreen() { Let's get you set up on Nostr.

- With an account on Nostr, you'll be able to use with any client that - you want. + With an account on Nostr, you'll be able to travel across all nostr + clients, all your data are synced.

{!services ? ( @@ -260,13 +264,22 @@ export function CreateAccountScreen() { - +
+ +

+ If you are using this option, please make sure keep your keys + in safe place. You{" "} + cannot recover if it + lost, all your data will be{" "} + lost forever. +

+
)} diff --git a/apps/desktop/src/routes/auth/onboarding.tsx b/apps/desktop/src/routes/auth/onboarding.tsx index 09fb4863..27cde070 100644 --- a/apps/desktop/src/routes/auth/onboarding.tsx +++ b/apps/desktop/src/routes/auth/onboarding.tsx @@ -1,15 +1,19 @@ import { useStorage } from "@lume/ark"; -import { InfoIcon } from "@lume/icons"; +import { InfoIcon, LoaderIcon } from "@lume/icons"; +import { delay } from "@lume/utils"; import * as Switch from "@radix-ui/react-switch"; import { isPermissionGranted, requestPermission, } from "@tauri-apps/plugin-notification"; import { useEffect, useState } from "react"; -import { Link } from "react-router-dom"; +import { useNavigate } from "react-router-dom"; export function OnboardingScreen() { const storage = useStorage(); + const navigate = useNavigate(); + + const [loading, setLoading] = useState(false); const [settings, setSettings] = useState({ autoupdate: false, notification: false, @@ -27,6 +31,12 @@ export function OnboardingScreen() { setSettings((prev) => ({ ...prev, notification: !settings.notification })); }; + const completeAuth = async () => { + setLoading(true); + await delay(1200); + navigate("/"); + }; + useEffect(() => { async function loadSettings() { const permissionGranted = await isPermissionGranted(); @@ -100,12 +110,17 @@ export function OnboardingScreen() { "Settings" screen. Be sure to visit it later.

- - Continue - + {loading ? ( + + ) : ( + "Continue" + )} + diff --git a/apps/desktop/src/routes/users/index.tsx b/apps/desktop/src/routes/users/index.tsx index 03d46953..ea592790 100644 --- a/apps/desktop/src/routes/users/index.tsx +++ b/apps/desktop/src/routes/users/index.tsx @@ -77,13 +77,13 @@ export function UserScreen() { type="button" onClick={() => fetchNextPage()} disabled={!hasNextPage || isFetchingNextPage} - className="inline-flex h-10 w-max items-center justify-center gap-2 rounded-full bg-blue-500 px-6 font-medium text-white hover:bg-blue-600 focus:outline-none" + className="inline-flex items-center justify-center w-full h-12 gap-2 font-medium bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-900 dark:hover:bg-neutral-800 rounded-xl focus:outline-none" > {isFetchingNextPage ? ( - + ) : ( <> - + Load more )} diff --git a/packages/lume-column-antenas/src/home.tsx b/packages/lume-column-antenas/src/home.tsx index 0220d664..461b42ab 100644 --- a/packages/lume-column-antenas/src/home.tsx +++ b/packages/lume-column-antenas/src/home.tsx @@ -114,13 +114,13 @@ export function HomeRoute({ type="button" onClick={() => fetchNextPage()} disabled={!hasNextPage || isFetchingNextPage} - className="inline-flex items-center justify-center w-40 h-10 gap-2 font-medium text-white bg-blue-500 rounded-full hover:bg-blue-600 focus:outline-none" + className="inline-flex items-center justify-center w-full h-12 gap-2 font-medium bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-900 dark:hover:bg-neutral-800 rounded-xl focus:outline-none" > {isFetchingNextPage ? ( - + ) : ( <> - + Load more )} diff --git a/packages/lume-column-group/src/home.tsx b/packages/lume-column-group/src/home.tsx index f92e2686..6e9db262 100644 --- a/packages/lume-column-group/src/home.tsx +++ b/packages/lume-column-group/src/home.tsx @@ -100,13 +100,13 @@ export function HomeRoute({ type="button" onClick={() => fetchNextPage()} disabled={!hasNextPage || isFetchingNextPage} - className="inline-flex items-center justify-center w-40 h-10 gap-2 font-medium text-white bg-blue-500 rounded-full hover:bg-blue-600 focus:outline-none" + className="inline-flex items-center justify-center w-full h-12 gap-2 font-medium bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-900 dark:hover:bg-neutral-800 rounded-xl focus:outline-none" > {isFetchingNextPage ? ( - + ) : ( <> - + Load more )} diff --git a/packages/lume-column-hashtag/src/home.tsx b/packages/lume-column-hashtag/src/home.tsx index c4de2b3d..d7504b8f 100644 --- a/packages/lume-column-hashtag/src/home.tsx +++ b/packages/lume-column-hashtag/src/home.tsx @@ -90,13 +90,13 @@ export function HomeRoute({ type="button" onClick={() => fetchNextPage()} disabled={!hasNextPage || isFetchingNextPage} - className="inline-flex items-center justify-center w-40 h-10 gap-2 font-medium text-white bg-blue-500 rounded-full hover:bg-blue-600 focus:outline-none" + className="inline-flex items-center justify-center w-full h-12 gap-2 font-medium bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-900 dark:hover:bg-neutral-800 rounded-xl focus:outline-none" > {isFetchingNextPage ? ( - + ) : ( <> - + Load more )} diff --git a/packages/lume-column-timeline/src/home.tsx b/packages/lume-column-timeline/src/home.tsx index ee934118..ff510603 100644 --- a/packages/lume-column-timeline/src/home.tsx +++ b/packages/lume-column-timeline/src/home.tsx @@ -106,13 +106,13 @@ export function HomeRoute({ colKey }: { colKey: string }) { type="button" onClick={() => fetchNextPage()} disabled={!hasNextPage || isFetchingNextPage} - className="inline-flex items-center justify-center w-40 h-10 gap-2 font-medium text-white bg-blue-500 rounded-full hover:bg-blue-600 focus:outline-none" + className="inline-flex items-center justify-center w-full h-12 gap-2 font-medium bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-900 dark:hover:bg-neutral-800 rounded-xl focus:outline-none" > {isFetchingNextPage ? ( - + ) : ( <> - + Load more )} diff --git a/packages/lume-column-user/src/home.tsx b/packages/lume-column-user/src/home.tsx index f84b11a8..e93579ff 100644 --- a/packages/lume-column-user/src/home.tsx +++ b/packages/lume-column-user/src/home.tsx @@ -181,13 +181,13 @@ export function HomeRoute({ id }: { id: string }) { type="button" onClick={() => fetchNextPage()} disabled={!hasNextPage || isFetchingNextPage} - className="inline-flex items-center justify-center h-10 gap-2 px-6 font-medium text-white bg-blue-500 rounded-full w-max hover:bg-blue-600 focus:outline-none" + className="inline-flex items-center justify-center w-full h-12 gap-2 font-medium bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-900 dark:hover:bg-neutral-800 rounded-xl focus:outline-none" > {isFetchingNextPage ? ( - + ) : ( <> - + Load more )} diff --git a/packages/ui/src/avatarUploadButton.tsx b/packages/ui/src/avatarUploadButton.tsx index 86d728ac..2b3fc738 100644 --- a/packages/ui/src/avatarUploadButton.tsx +++ b/packages/ui/src/avatarUploadButton.tsx @@ -16,7 +16,7 @@ export function AvatarUploadButton({ // start loading setLoading(true); - const image = await ark.upload({}); + const image = await ark.upload({ fileExts: [] }); if (image) { setPicture(image); diff --git a/packages/ui/src/onboarding/finish.tsx b/packages/ui/src/onboarding/finish.tsx index ccd31932..d9c394e2 100644 --- a/packages/ui/src/onboarding/finish.tsx +++ b/packages/ui/src/onboarding/finish.tsx @@ -1,11 +1,24 @@ import { CheckIcon } from "@lume/icons"; import { onboardingAtom } from "@lume/utils"; +import { useQueryClient } from "@tanstack/react-query"; import { motion } from "framer-motion"; import { useSetAtom } from "jotai"; export function OnboardingFinishScreen() { + const queryClient = useQueryClient(); const setOnboarding = useSetAtom(onboardingAtom); + const finish = async () => { + const queryCache = queryClient.getQueryCache(); + const queryKeys = queryCache.getAll().map((cache) => cache.queryKey); + + for (const key of queryKeys) { + await queryClient.refetchQueries({ queryKey: key }); + } + + setOnboarding(false); + }; + return ( +
diff --git a/packages/ui/src/routes/user.tsx b/packages/ui/src/routes/user.tsx index dc4e67d9..ad332bba 100644 --- a/packages/ui/src/routes/user.tsx +++ b/packages/ui/src/routes/user.tsx @@ -193,13 +193,13 @@ export function UserRoute() { type="button" onClick={() => fetchNextPage()} disabled={!hasNextPage || isFetchingNextPage} - className="inline-flex h-10 w-max items-center justify-center gap-2 rounded-full bg-blue-500 px-6 font-medium text-white hover:bg-blue-600 focus:outline-none" + className="inline-flex items-center justify-center w-full h-12 gap-2 font-medium bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-900 dark:hover:bg-neutral-800 rounded-xl focus:outline-none" > {isFetchingNextPage ? ( - + ) : ( <> - + Load more )}