mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-02-08 15:54:29 +01:00
add setup restore route, organize setup routes into folder
This commit is contained in:
committed by
Tony Giorgio
parent
2b2b514735
commit
014764feb1
@@ -693,6 +693,7 @@
|
||||
},
|
||||
"onboarding": {
|
||||
"welcome": "Welcome!",
|
||||
"setup": "Setup",
|
||||
"restore_from_backup": "If you've used Mutiny before you can restore from a backup. Otherwise you can skip this and enjoy your new wallet!",
|
||||
"not_available": "We don't do that yet",
|
||||
"secure_your_funds": "Secure your funds"
|
||||
|
||||
@@ -3,12 +3,17 @@ import { ChevronLeft } from "lucide-solid";
|
||||
|
||||
import { useI18n } from "~/i18n/context";
|
||||
|
||||
export function BackLink(props: { href?: string; title?: string }) {
|
||||
export function BackLink(props: {
|
||||
href?: string;
|
||||
title?: string;
|
||||
showOnDesktop?: boolean;
|
||||
}) {
|
||||
const i18n = useI18n();
|
||||
return (
|
||||
<A
|
||||
href={props.href ? props.href : "/"}
|
||||
class="-mx-2 flex items-center text-xl font-semibold text-white no-underline active:-mb-[1px] active:mt-[1px] active:text-white/80 md:hidden"
|
||||
classList={{ "md:!flex": props.showOnDesktop }}
|
||||
>
|
||||
<ChevronLeft class="h-7 w-7" />
|
||||
{props.title ? props.title : i18n.t("common.home")}
|
||||
|
||||
@@ -23,9 +23,7 @@ import {
|
||||
EditProfile,
|
||||
Feedback,
|
||||
Gift as GiftReceive,
|
||||
ImportProfile,
|
||||
Main,
|
||||
NewProfile,
|
||||
NotFound,
|
||||
Profile,
|
||||
Receive,
|
||||
@@ -34,7 +32,6 @@ import {
|
||||
Scanner,
|
||||
Search,
|
||||
Send,
|
||||
Setup,
|
||||
Swap,
|
||||
SwapLightning
|
||||
} from "~/routes";
|
||||
@@ -55,6 +52,7 @@ import {
|
||||
Servers,
|
||||
Settings
|
||||
} from "~/routes/settings";
|
||||
import { ImportProfile, NewProfile, Setup, SetupRestore } from "~/routes/setup";
|
||||
import { Provider as MegaStoreProvider, useMegaStore } from "~/state/megaStore";
|
||||
|
||||
function GlobalListeners() {
|
||||
@@ -158,6 +156,7 @@ export function Router() {
|
||||
>
|
||||
<Route path="/" component={Main} />
|
||||
<Route path="/setup" component={Setup} />
|
||||
<Route path="/setup/restore" component={SetupRestore} />
|
||||
<Route path="/newprofile" component={NewProfile} />
|
||||
<Route path="/editprofile" component={EditProfile} />
|
||||
<Route path="/importprofile" component={ImportProfile} />
|
||||
|
||||
@@ -11,8 +11,5 @@ export * from "./Search";
|
||||
export * from "./Redeem";
|
||||
export * from "./Profile";
|
||||
export * from "./Chat";
|
||||
export * from "./Setup";
|
||||
export * from "./NewProfile";
|
||||
export * from "./Request";
|
||||
export * from "./ImportProfile";
|
||||
export * from "./EditProfile";
|
||||
|
||||
@@ -77,7 +77,7 @@ function SeedTextField(props: TextFieldProps) {
|
||||
);
|
||||
}
|
||||
|
||||
function TwelveWordsEntry() {
|
||||
export function TwelveWordsEntry() {
|
||||
const i18n = useI18n();
|
||||
const [state, actions] = useMegaStore();
|
||||
|
||||
|
||||
30
src/routes/setup/Restore.tsx
Normal file
30
src/routes/setup/Restore.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import {
|
||||
BackLink,
|
||||
DefaultMain,
|
||||
LargeHeader,
|
||||
NiceP,
|
||||
VStack
|
||||
} from "~/components";
|
||||
import { useI18n } from "~/i18n/context";
|
||||
import { TwelveWordsEntry } from "~/routes/settings/Restore";
|
||||
|
||||
export function SetupRestore() {
|
||||
const i18n = useI18n();
|
||||
return (
|
||||
<DefaultMain>
|
||||
<BackLink
|
||||
showOnDesktop
|
||||
title={i18n.t("modals.onboarding.setup")}
|
||||
href="/setup"
|
||||
/>
|
||||
<LargeHeader>{i18n.t("settings.restore.title")}</LargeHeader>
|
||||
<VStack>
|
||||
<NiceP>
|
||||
<p>{i18n.t("settings.restore.restore_tip")}</p>
|
||||
<p>{i18n.t("settings.restore.multi_browser_warning")}</p>
|
||||
</NiceP>
|
||||
<TwelveWordsEntry />
|
||||
</VStack>
|
||||
</DefaultMain>
|
||||
);
|
||||
}
|
||||
@@ -62,7 +62,7 @@ export function Setup() {
|
||||
intent="text"
|
||||
layout="full"
|
||||
disabled={isCreatingNewWallet()}
|
||||
onClick={() => navigate("/settings/restore")}
|
||||
onClick={() => navigate("/setup/restore")}
|
||||
>
|
||||
Import Existing
|
||||
</Button>
|
||||
4
src/routes/setup/index.ts
Normal file
4
src/routes/setup/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from "./Restore";
|
||||
export * from "./ImportProfile";
|
||||
export * from "./NewProfile";
|
||||
export * from "./Root";
|
||||
Reference in New Issue
Block a user