From 2a417881bb5c67cf889d54932025badf5a85a9e0 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 20 Jan 2022 13:13:53 -0300 Subject: fix permission api, grouping all cta into same path --- .../src/walletEntryPoint.tsx | 123 ++++++++++++--------- 1 file changed, 73 insertions(+), 50 deletions(-) (limited to 'packages/taler-wallet-webextension/src/walletEntryPoint.tsx') diff --git a/packages/taler-wallet-webextension/src/walletEntryPoint.tsx b/packages/taler-wallet-webextension/src/walletEntryPoint.tsx index 978d6fde5..85e38d85a 100644 --- a/packages/taler-wallet-webextension/src/walletEntryPoint.tsx +++ b/packages/taler-wallet-webextension/src/walletEntryPoint.tsx @@ -78,6 +78,9 @@ function Application(): VNode { string | undefined >(undefined); const hash_history = createHashHistory(); + function clearNotification(): void { + setGlobalNotification(undefined); + } return (
@@ -94,21 +97,36 @@ function Application(): VNode { {globalNotification && ( - setGlobalNotification(undefined)}> +
{globalNotification}
)} - + { + // const movingOutFromNotification = + // globalNotification && e.url !== globalNotification.to; + if (globalNotification) { + setGlobalNotification(undefined); + } + }} + > + {/** + * BALANCE + */} + - route(Pages.manual_withdraw.replace(":currency?", "")) + route( + Pages.balance_manual_withdraw.replace(":currency?", ""), + ) } goToWalletDeposit={(currency: string) => - route(Pages.deposit.replace(":currency", currency)) + route(Pages.balance_deposit.replace(":currency", currency)) } goToWalletHistory={(currency: string) => route(Pages.balance_history.replace(":currency", currency)) @@ -118,90 +136,97 @@ function Application(): VNode { path={Pages.balance_history} component={HistoryPage} goToWalletDeposit={(currency: string) => - route(Pages.deposit.replace(":currency", currency)) + route(Pages.balance_deposit.replace(":currency", currency)) } goToWalletManualWithdraw={(currency?: string) => route( - Pages.manual_withdraw.replace( + Pages.balance_manual_withdraw.replace( ":currency?", currency || "", ), ) } /> + + + + + { + route(Pages.balance_history.replace(":currency", currency)); + setGlobalNotification( + "All done, your transaction is in progress", + ); + }} + /> + {/** + * LAST ACTIVITY + */} - + + {/** + * BACKUP + */} { - route(Pages.provider_add); + route(Pages.backup_provider_add); }} /> { route(Pages.backup); }} /> { route(Pages.backup); }} /> + {/** + * SETTINGS + */} { route(Pages.balance); }} /> - - - { - route(Pages.balance_history.replace(":currency", currency)); - setGlobalNotification( - "All done, your transaction is in progress", - ); - }} - /> -
no yet implemented
} - /> -
no yet implemented
} - /> -
no yet implemented
} - /> + {/** + * DEV + */} - {/** call to action */} + {/** + * CALL TO ACTION + */} route( - Pages.manual_withdraw.replace( + Pages.balance_manual_withdraw.replace( ":currency?", currency || "", ), @@ -209,15 +234,13 @@ function Application(): VNode { } goBack={() => route(Pages.balance)} /> - route(Pages.balance)} - /> - - - + + + + {/** + * NOT FOUND + */}
@@ -230,7 +253,7 @@ function Application(): VNode { function Redirect({ to }: { to: string }): null { useEffect(() => { - console.log("go some wrong route"); + console.log("got some wrong route", to); route(to, true); }); return null; -- cgit v1.2.3