taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit fc42d265b907973a04b607f81b61716931ca62d0
parent 26590fbae822733556cb1011b5b6e0eea1d23d9e
Author: Sebastian <sebasjm@gmail.com>
Date:   Sun,  4 Feb 2024 18:29:05 -0300

rename tip to rewards

Diffstat:
Mpackages/taler-wallet-webextension/src/NavigationBar.tsx | 3++-
Mpackages/taler-wallet-webextension/src/platform/chrome.ts | 2+-
Mpackages/taler-wallet-webextension/src/popup/TalerActionFound.tsx | 6+++---
Mpackages/taler-wallet-webextension/src/wallet/Application.tsx | 16+++++++++++++++-
4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/packages/taler-wallet-webextension/src/NavigationBar.tsx b/packages/taler-wallet-webextension/src/NavigationBar.tsx @@ -126,6 +126,7 @@ export const Pages = { ctaRecovery: "/cta/recovery", ctaRefund: "/cta/refund", ctaTips: "/cta/tip", + ctaRewards: "/cta/rewards", ctaWithdraw: "/cta/withdraw", ctaDeposit: "/cta/deposit", ctaInvoiceCreate: pageDefinition<{ amount?: string }>( @@ -146,7 +147,7 @@ const talerUriActionToPageName: { } = { [TalerUriAction.Withdraw]: "ctaWithdraw", [TalerUriAction.Pay]: "ctaPay", - [TalerUriAction.Reward]: "ctaTips", + [TalerUriAction.Reward]: "ctaRewards", [TalerUriAction.Refund]: "ctaRefund", [TalerUriAction.PayPull]: "ctaInvoicePay", [TalerUriAction.PayPush]: "ctaTransferPickup", diff --git a/packages/taler-wallet-webextension/src/platform/chrome.ts b/packages/taler-wallet-webextension/src/platform/chrome.ts @@ -207,7 +207,7 @@ function openWalletURIFromPopup(uri: TalerUri): void { break; case TalerUriAction.Reward: url = chrome.runtime.getURL( - `static/wallet.html#/cta/tip?talerUri=${encodeURIComponent(talerUri)}`, + `static/wallet.html#/cta/rewards?talerUri=${encodeURIComponent(talerUri)}`, ); break; case TalerUriAction.Refund: diff --git a/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx b/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx @@ -19,7 +19,7 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { parseTalerUri, TalerUri, TalerUriAction } from "@gnu-taler/taler-util"; +import { parseTalerUri, stringifyTalerUri, TalerUri, TalerUriAction } from "@gnu-taler/taler-util"; import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { Title } from "../components/styled/index.js"; @@ -69,10 +69,10 @@ function ContentByUriType({ return ( <div> <p> - <i18n.Translate>This page has a tip action.</i18n.Translate> + <i18n.Translate>This page has a reward action.</i18n.Translate> </p> <Button variant="contained" color="success" onClick={onConfirm}> - <i18n.Translate>Open tip page</i18n.Translate> + <i18n.Translate>Open reward page</i18n.Translate> </Button> </div> ); diff --git a/packages/taler-wallet-webextension/src/wallet/Application.tsx b/packages/taler-wallet-webextension/src/wallet/Application.tsx @@ -368,7 +368,21 @@ export function Application(): VNode { <Route path={Pages.ctaTips} component={({ talerUri }: { talerUri: string }) => ( - <CallToActionTemplate title={i18n.str`Digital cash tip`}> + <CallToActionTemplate title={i18n.str`Digital cash rewards`}> + <TipPage + talerTipUri={decodeURIComponent(talerUri)} + onCancel={() => redirectTo(Pages.balance)} + onSuccess={(tid: string) => + redirectTo(Pages.balanceTransaction({ tid })) + } + /> + </CallToActionTemplate> + )} + /> + <Route + path={Pages.ctaRewards} + component={({ talerUri }: { talerUri: string }) => ( + <CallToActionTemplate title={i18n.str`Digital cash rewards`}> <TipPage talerTipUri={decodeURIComponent(talerUri)} onCancel={() => redirectTo(Pages.balance)}