From fb22009ec4799a624f00c228fbd7435b44c1cbac Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 10 Jan 2022 16:04:53 -0300 Subject: deposit design from belen, feature missing: kyc --- .../src/walletEntryPoint.tsx | 285 +++++++++++---------- 1 file changed, 151 insertions(+), 134 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 938892874..b54d49ded 100644 --- a/packages/taler-wallet-webextension/src/walletEntryPoint.tsx +++ b/packages/taler-wallet-webextension/src/walletEntryPoint.tsx @@ -22,31 +22,32 @@ import { setupI18n } from "@gnu-taler/taler-util"; import { createHashHistory } from "history"; -import { Fragment, h, render, VNode } from "preact"; +import { h, render, VNode } from "preact"; import Router, { route, Route } from "preact-router"; -import { useEffect } from "preact/hooks"; +import { useEffect, useState } from "preact/hooks"; import { LogoHeader } from "./components/LogoHeader"; +import { SuccessBox, WalletBox } from "./components/styled"; import { DevContextProvider } from "./context/devContext"; +import { IoCProviderForRuntime } from "./context/iocContext"; import { PayPage } from "./cta/Pay"; import { RefundPage } from "./cta/Refund"; import { TipPage } from "./cta/Tip"; import { WithdrawPage } from "./cta/Withdraw"; import { strings } from "./i18n/strings"; import { Pages, WalletNavBar } from "./NavigationBar"; +import { DeveloperPage } from "./popup/DeveloperPage"; +import { BackupPage } from "./wallet/BackupPage"; import { BalancePage } from "./wallet/BalancePage"; +import { DepositPage } from "./wallet/DepositPage"; +import { ExchangeAddPage } from "./wallet/ExchangeAddPage"; import { HistoryPage } from "./wallet/History"; +import { LastActivityPage } from "./wallet/LastActivityPage"; +import { ManualWithdrawPage } from "./wallet/ManualWithdrawPage"; +import { ProviderAddPage } from "./wallet/ProviderAddPage"; +import { ProviderDetailPage } from "./wallet/ProviderDetailPage"; import { SettingsPage } from "./wallet/Settings"; import { TransactionPage } from "./wallet/Transaction"; import { WelcomePage } from "./wallet/Welcome"; -import { BackupPage } from "./wallet/BackupPage"; -import { DeveloperPage } from "./popup/DeveloperPage"; -import { ManualWithdrawPage } from "./wallet/ManualWithdrawPage"; -import { WalletBox } from "./components/styled"; -import { ProviderDetailPage } from "./wallet/ProviderDetailPage"; -import { ProviderAddPage } from "./wallet/ProviderAddPage"; -import { ExchangeAddPage } from "./wallet/ExchangeAddPage"; -import { DepositPage } from "./wallet/DepositPage"; -import { IoCProviderForRuntime } from "./context/iocContext"; function main(): void { try { @@ -71,140 +72,156 @@ if (document.readyState === "loading") { main(); } -function withLogoAndNavBar(Component: any) { - return function withLogoAndNavBarComponent(props: any): VNode { - return ( - - - - - - - - ); - }; -} - function Application(): VNode { + const [globalNotification, setGlobalNotification] = useState< + string | undefined + >(undefined); return (
- - - - - - - route(Pages.manual_withdraw)} - goToWalletDeposit={(currency: string) => - route(Pages.deposit.replace(":currency", currency)) - } - /> - - { - route(Pages.provider_add); - }} - /> - { - route(Pages.backup); - }} - /> - { - route(Pages.backup); - }} - /> - - { - route(Pages.balance); - }} - /> - - - - -
no yet implemented
} - /> -
no yet implemented
} - /> -
no yet implemented
} - /> - - - - {/** call to action */} - - goToWalletPage(Pages.manual_withdraw) - } - /> - - - - - -
-
+ {({ devMode }: { devMode: boolean }) => ( + + + + + {globalNotification && ( + setGlobalNotification(undefined)}> +
{globalNotification}
+
+ )} + + + + + route(Pages.manual_withdraw.replace(":currency?", "")) + } + goToWalletDeposit={(currency: string) => + route(Pages.deposit.replace(":currency", currency)) + } + goToWalletHistory={(currency: string) => + route(Pages.balance_history.replace(":currency", currency)) + } + /> + + route(Pages.deposit.replace(":currency", currency)) + } + goToWalletManualWithdraw={(currency?: string) => + route( + Pages.manual_withdraw.replace( + ":currency?", + currency || "", + ), + ) + } + /> + + + + { + route(Pages.provider_add); + }} + /> + { + route(Pages.backup); + }} + /> + { + route(Pages.backup); + }} + /> + + { + 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
} + /> + + + + {/** call to action */} + + route( + Pages.manual_withdraw.replace( + ":currency?", + currency || "", + ), + ) + } + goBack={() => route(Pages.balance)} + /> + route(Pages.balance)} + /> + + + + + +
+
+
+ )}
); } -function goToWalletPage(page: Pages | string): null { - // eslint-disable-next-line no-undef - chrome.tabs.create({ - active: true, - // eslint-disable-next-line no-undef - url: chrome.extension.getURL(`/static/wallet.html#${page}`), - }); - return null; -} - function Redirect({ to }: { to: string }): null { useEffect(() => { + console.log("go some wrong route"); route(to, true); }); return null; -- cgit v1.2.3