diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet')
5 files changed, 115 insertions, 4 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Application.tsx b/packages/taler-wallet-webextension/src/wallet/Application.tsx index f559e54db..a13094646 100644 --- a/packages/taler-wallet-webextension/src/wallet/Application.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Application.tsx @@ -53,6 +53,10 @@ import { TransactionPage } from "./Transaction.js"; import { WelcomePage } from "./Welcome.js"; import { QrReaderPage } from "./QrReader.js"; import { platform } from "../platform/api.js"; +import { + DestinationSelectionGetCash, + DestinationSelectionSendCash, +} from "./DestinationSelection.js"; export function Application(): VNode { const [globalNotification, setGlobalNotification] = useState< @@ -126,13 +130,21 @@ export function Application(): VNode { path={Pages.balanceHistory.pattern} component={HistoryPage} goToWalletDeposit={(currency: string) => - redirectTo(Pages.balanceDeposit({ currency })) + redirectTo(Pages.sendCash({ currency })) } goToWalletManualWithdraw={(currency?: string) => - redirectTo(Pages.balanceManualWithdraw({ currency })) + redirectTo(Pages.receiveCash({ currency })) } /> <Route + path={Pages.sendCash.pattern} + component={DestinationSelectionSendCash} + /> + <Route + path={Pages.receiveCash.pattern} + component={DestinationSelectionGetCash} + /> + <Route path={Pages.balanceTransaction.pattern} component={TransactionPage} goToWalletHistory={(currency?: string) => diff --git a/packages/taler-wallet-webextension/src/wallet/DestinationSelection.stories.tsx b/packages/taler-wallet-webextension/src/wallet/DestinationSelection.stories.tsx new file mode 100644 index 000000000..876f683f6 --- /dev/null +++ b/packages/taler-wallet-webextension/src/wallet/DestinationSelection.stories.tsx @@ -0,0 +1,37 @@ +/* + This file is part of GNU Taler + (C) 2022 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + +/** + * + * @author Sebastian Javier Marchano (sebasjm) + */ + +import { createExample } from "../test-utils.js"; +import { + DestinationSelectionGetCash, + DestinationSelectionSendCash, +} from "./DestinationSelection.js"; + +export default { + title: "wallet/destination", +}; + +export const GetCash = createExample(DestinationSelectionGetCash, { + currency: "usd", +}); +export const SendCash = createExample(DestinationSelectionSendCash, { + currency: "eur", +}); diff --git a/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx b/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx new file mode 100644 index 000000000..187a2412f --- /dev/null +++ b/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx @@ -0,0 +1,60 @@ +/* + This file is part of GNU Taler + (C) 2022 Taler Systems S.A. + + GNU Taler is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ + +import { styled } from "@linaria/react"; +import { Fragment, h, VNode } from "preact"; +import { Paper } from "../mui/Paper.js"; + +const QrVideo = styled.video` + width: 80%; + margin-left: auto; + margin-right: auto; + padding: 8px; + background-color: black; +`; + +const Container = styled.div` + display: flex; + flex-direction: column; + & > * { + margin: 8px; + } +`; + +interface Props { + action: "send" | "get"; + currency?: string; +} + +export function DestinationSelectionGetCash({ currency }: Props): VNode { + return ( + <Container> + <p>Request {currency} from:</p> + <Paper style={{ padding: 8 }}>Bank account</Paper> + <Paper style={{ padding: 8 }}>Another person</Paper> + </Container> + ); +} + +export function DestinationSelectionSendCash({ currency }: Props): VNode { + return ( + <Container> + <p>Sending {currency} to:</p> + <Paper style={{ padding: 8 }}>Bank account</Paper> + <Paper style={{ padding: 8 }}>Another person</Paper> + </Container> + ); +} diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx b/packages/taler-wallet-webextension/src/wallet/History.tsx index e40c1ac5b..f331cc457 100644 --- a/packages/taler-wallet-webextension/src/wallet/History.tsx +++ b/packages/taler-wallet-webextension/src/wallet/History.tsx @@ -210,7 +210,7 @@ export function HistoryView({ // style={{ marginLeft: 0, marginTop: 8 }} onClick={() => goToWalletManualWithdraw(selectedCurrency)} > - <i18n.Translate>Withdraw</i18n.Translate> + <i18n.Translate>Get</i18n.Translate> </Button> {currencyAmount && Amounts.isNonZero(currencyAmount) && ( <Button @@ -219,7 +219,7 @@ export function HistoryView({ // style={{ marginLeft: 0, marginTop: 8 }} onClick={() => goToWalletDeposit(selectedCurrency)} > - <i18n.Translate>Deposit</i18n.Translate> + <i18n.Translate>Send</i18n.Translate> </Button> )} </div> diff --git a/packages/taler-wallet-webextension/src/wallet/index.stories.tsx b/packages/taler-wallet-webextension/src/wallet/index.stories.tsx index fc09ea541..25537691d 100644 --- a/packages/taler-wallet-webextension/src/wallet/index.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/index.stories.tsx @@ -35,6 +35,7 @@ import * as a14 from "./Welcome.stories.js"; import * as a15 from "./AddNewActionView.stories.js"; import * as a16 from "./DeveloperPage.stories.js"; import * as a17 from "./QrReader.stories.js"; +import * as a18 from "./DestinationSelection.stories.js"; export default [ a1, @@ -53,4 +54,5 @@ export default [ a15, a16, a17, + a18, ]; |