diff options
author | Sebastian <sebasjm@gmail.com> | 2022-12-07 10:59:12 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-12-07 16:08:16 -0300 |
commit | 0fa3b8ddb93e2d0352da82a6f2b07304ea239c28 (patch) | |
tree | 2df551b0bfa5fbbe8897bdfcb5f0ed2fdbe07b38 /packages/demobank-ui/src/pages/home/index.tsx | |
parent | ac2f680f6805534fdebad41755d7e112a00cd15a (diff) | |
download | wallet-core-0fa3b8ddb93e2d0352da82a6f2b07304ea239c28.tar.xz |
no-fix: move out routing
Diffstat (limited to 'packages/demobank-ui/src/pages/home/index.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/home/index.tsx | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/packages/demobank-ui/src/pages/home/index.tsx b/packages/demobank-ui/src/pages/home/index.tsx index 9927f965c..64ceedf66 100644 --- a/packages/demobank-ui/src/pages/home/index.tsx +++ b/packages/demobank-ui/src/pages/home/index.tsx @@ -2079,7 +2079,7 @@ function PublicHistories(Props: any): VNode { ); } -function PublicHistoriesPage(): VNode { +export function PublicHistoriesPage(): VNode { const { pageState, pageStateSetter } = usePageContext(); // const { i18n } = useTranslationContext(); return ( @@ -2104,7 +2104,7 @@ function PublicHistoriesPage(): VNode { ); } -function RegistrationPage(): VNode { +export function RegistrationPage(): VNode { const { i18n } = useTranslationContext(); if (!bankUiSettings.allowRegistrations) { return ( @@ -2120,7 +2120,7 @@ function RegistrationPage(): VNode { ); } -function AccountPage(): VNode { +export function AccountPage(): VNode { const [backendState, backendStateSetter] = useBackendState(); const { i18n } = useTranslationContext(); const { pageState, pageStateSetter } = usePageContext(); @@ -2129,10 +2129,7 @@ function AccountPage(): VNode { return ( <BankFrame> <h1 class="nav">{i18n.str`Welcome to ${bankUiSettings.bankName}!`}</h1> - <LoginForm - pageStateSetter={pageStateSetter} - backendStateSetter={backendStateSetter} - /> + <LoginForm /> </BankFrame> ); } @@ -2162,26 +2159,3 @@ function AccountPage(): VNode { </SWRWithCredentials> ); } - -function Redirect({ to }: { to: string }): VNode { - useEffect(() => { - route(to, true); - }, []); - return <div>being redirected to {to}</div>; -} - -/** - * If the user is logged in, it displays - * the balance, otherwise it offers to login. - */ -export function BankHome(): VNode { - const history = createHashHistory(); - return ( - <Router history={history}> - <Route path="/public-accounts" component={PublicHistoriesPage} /> - <Route path="/register" component={RegistrationPage} /> - <Route path="/account/:id*" component={AccountPage} /> - <Route default component={Redirect} to="/account" /> - </Router> - ); -} |