finish restucture

This commit is contained in:
Ren Amamiya 2023-04-27 18:43:13 +07:00
parent b2b5cb50f0
commit 76bdeca4ab
21 changed files with 9 additions and 10 deletions

View File

@ -125,7 +125,7 @@ export function Page() {
() => { () => {
updateLastLogin(dateToUnix(now.current)); updateLastLogin(dateToUnix(now.current));
timeout = setTimeout(() => { timeout = setTimeout(() => {
navigate('/newsfeed/following', { overwriteLastHistoryEntry: true }); navigate('/app/newsfeed/following', { overwriteLastHistoryEntry: true });
}, 5000); }, 5000);
} }
); );
@ -136,7 +136,7 @@ export function Page() {
if (res) { if (res) {
fetchInitalData(res, res.follows); fetchInitalData(res, res.follows);
} else { } else {
navigate('/onboarding', { overwriteLastHistoryEntry: true }); navigate('/auth', { overwriteLastHistoryEntry: true });
} }
}) })
.catch(console.error); .catch(console.error);

View File

@ -26,7 +26,7 @@ export function Page() {
const submit = () => { const submit = () => {
setOnboarding((prev) => ({ ...prev, pubkey: pubkey, privkey: privkey })); setOnboarding((prev) => ({ ...prev, pubkey: pubkey, privkey: privkey }));
navigate('/onboarding/create/step-2'); navigate('/auth/create/step-2');
}; };
return ( return (

View File

@ -30,7 +30,7 @@ export function Page() {
const onSubmit = (data: any) => { const onSubmit = (data: any) => {
setLoading(true); setLoading(true);
setOnboarding((prev) => ({ ...prev, metadata: data })); setOnboarding((prev) => ({ ...prev, metadata: data }));
navigate('/onboarding/create/step-3'); navigate('/auth/create/step-3');
}; };
useEffect(() => { useEffect(() => {

View File

@ -1,4 +1,4 @@
import User from '@lume/onboarding/components/user'; import User from '@lume/auth/components/user';
import { WRITEONLY_RELAYS } from '@lume/stores/constants'; import { WRITEONLY_RELAYS } from '@lume/stores/constants';
import { onboardingAtom } from '@lume/stores/onboarding'; import { onboardingAtom } from '@lume/stores/onboarding';
import { createAccount, createPleb } from '@lume/utils/storage'; import { createAccount, createPleb } from '@lume/utils/storage';

View File

@ -43,7 +43,7 @@ export function Page() {
if (typeof getPublicKey(privkey) === 'string') { if (typeof getPublicKey(privkey) === 'string') {
setOnboardingPrivkey((prev) => ({ ...prev, privkey: privkey })); setOnboardingPrivkey((prev) => ({ ...prev, privkey: privkey }));
navigate(`/onboarding/import/step-2`); navigate(`/auth/import/step-2`);
} }
} catch (error) { } catch (error) {
setError('key', { setError('key', {

View File

@ -2,7 +2,6 @@ import { DEFAULT_AVATAR, READONLY_RELAYS } from '@lume/stores/constants';
import { onboardingAtom } from '@lume/stores/onboarding'; import { onboardingAtom } from '@lume/stores/onboarding';
import { shortenKey } from '@lume/utils/shortenKey'; import { shortenKey } from '@lume/utils/shortenKey';
import { createAccount, createPleb } from '@lume/utils/storage'; import { createAccount, createPleb } from '@lume/utils/storage';
import { nip02ToArray } from '@lume/utils/transform';
import { useAtom } from 'jotai'; import { useAtom } from 'jotai';
import { RelayPool } from 'nostr-relaypool'; import { RelayPool } from 'nostr-relaypool';
@ -37,7 +36,7 @@ export function Page() {
setOnboarding((prev) => ({ ...prev, metadata: event.content })); setOnboarding((prev) => ({ ...prev, metadata: event.content }));
break; break;
case 3: case 3:
setOnboarding((prev) => ({ ...prev, follows: nip02ToArray(event.tags) })); setOnboarding((prev) => ({ ...prev, follows: event.tags }));
break; break;
default: default:
break; break;

View File

@ -95,14 +95,14 @@ export function Page() {
</h1> </h1>
<div className="mt-4 flex flex-col items-center gap-1.5"> <div className="mt-4 flex flex-col items-center gap-1.5">
<a <a
href="/onboarding/create" href="/auth/create"
className="relative inline-flex h-14 w-64 items-center justify-center gap-2 rounded-full bg-zinc-900 px-6 text-lg font-medium ring-1 ring-zinc-800 hover:bg-zinc-800" className="relative inline-flex h-14 w-64 items-center justify-center gap-2 rounded-full bg-zinc-900 px-6 text-lg font-medium ring-1 ring-zinc-800 hover:bg-zinc-800"
> >
Create new key Create new key
<ArrowRight width={20} height={20} /> <ArrowRight width={20} height={20} />
</a> </a>
<a <a
href="/onboarding/import" href="/auth/import"
className="inline-flex h-14 w-64 items-center justify-center gap-2 rounded-full px-6 text-base font-medium text-zinc-300 hover:bg-zinc-800" className="inline-flex h-14 w-64 items-center justify-center gap-2 rounded-full px-6 text-base font-medium text-zinc-300 hover:bg-zinc-800"
> >
Login with private key Login with private key