diff options
7 files changed, 33 insertions, 23 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/views.tsx b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/views.tsx index b67bbb216..c6d3e689c 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/views.tsx @@ -34,6 +34,7 @@ import { InvoiceCreationDetails, } from "../../wallet/Transaction.js"; import { State } from "./index.js"; +import { TermsOfService } from "../../components/TermsOfService/index.js"; export function ReadyView({ exchangeUrl, @@ -151,9 +152,11 @@ export function ReadyView({ /> </section> <section> - <Button onClick={create.onClick} variant="contained" color="success"> - <i18n.Translate>Create</i18n.Translate> - </Button> + <TermsOfService key="terms" exchangeUrl={exchangeUrl} > + <Button onClick={create.onClick} variant="contained" color="success"> + <i18n.Translate>Create</i18n.Translate> + </Button> + </TermsOfService> </section> </Fragment> ); diff --git a/packages/taler-wallet-webextension/src/cta/Refund/views.tsx b/packages/taler-wallet-webextension/src/cta/Refund/views.tsx index b6638cf8b..ef21a511e 100644 --- a/packages/taler-wallet-webextension/src/cta/Refund/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/Refund/views.tsx @@ -14,16 +14,13 @@ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { Amounts } from "@gnu-taler/taler-util"; +import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, h, VNode } from "preact"; import { Amount } from "../../components/Amount.js"; -import { LogoHeader } from "../../components/LogoHeader.js"; import { Part } from "../../components/Part.js"; -import { ProductList } from "../../components/ProductList.js"; -import { Link, SubTitle, WalletAction } from "../../components/styled/index.js"; -import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Button } from "../../mui/Button.js"; import { State } from "./index.js"; +import { TermsOfService } from "../../components/TermsOfService/index.js"; export function IgnoredView(state: State.Ignored): VNode { const { i18n } = useTranslationContext(); diff --git a/packages/taler-wallet-webextension/src/cta/Reward/state.ts b/packages/taler-wallet-webextension/src/cta/Reward/state.ts index 98463cb60..a71ad6acc 100644 --- a/packages/taler-wallet-webextension/src/cta/Reward/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Reward/state.ts @@ -64,7 +64,7 @@ export function useComponentState({ const doAccept = async (): Promise<void> => { const res = await api.wallet.call(WalletApiOperation.AcceptReward, { - walletRewardId: tip.walletRewardId, + walletRewardId: tip.transactionId, }); //FIX: this may not be seen since we are moving to the success also diff --git a/packages/taler-wallet-webextension/src/cta/Reward/views.tsx b/packages/taler-wallet-webextension/src/cta/Reward/views.tsx index 5d99a0132..3c3190a07 100644 --- a/packages/taler-wallet-webextension/src/cta/Reward/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/Reward/views.tsx @@ -23,6 +23,7 @@ import { Link, SubTitle, WalletAction } from "../../components/styled/index.js"; import { useTranslationContext } from "@gnu-taler/web-util/browser"; import { Button } from "../../mui/Button.js"; import { State } from "./index.js"; +import { TermsOfService } from "../../components/TermsOfService/index.js"; export function IgnoredView(state: State.Ignored): VNode { const { i18n } = useTranslationContext(); @@ -60,15 +61,17 @@ export function ReadyView(state: State.Ready): VNode { /> </section> <section> - <Button - variant="contained" - color="success" - onClick={state.accept.onClick} - > - <i18n.Translate> - Receive {<Amount value={state.amount} />} - </i18n.Translate> - </Button> + <TermsOfService key="terms" exchangeUrl={state.exchangeBaseUrl} > + <Button + variant="contained" + color="success" + onClick={state.accept.onClick} + > + <i18n.Translate> + Receive {<Amount value={state.amount} />} + </i18n.Translate> + </Button> + </TermsOfService> </section> </Fragment> ); diff --git a/packages/taler-wallet-webextension/src/cta/TransferPickup/index.ts b/packages/taler-wallet-webextension/src/cta/TransferPickup/index.ts index c01168307..4e1301d6a 100644 --- a/packages/taler-wallet-webextension/src/cta/TransferPickup/index.ts +++ b/packages/taler-wallet-webextension/src/cta/TransferPickup/index.ts @@ -53,6 +53,7 @@ export namespace State { export interface Ready extends BaseInfo { status: "ready"; effective: AmountJson; + exchangeBaseUrl: string; raw: AmountJson; summary: string | undefined; expiration: AbsoluteTime | undefined; diff --git a/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts b/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts index 47c644736..06ef80760 100644 --- a/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts +++ b/packages/taler-wallet-webextension/src/cta/TransferPickup/state.ts @@ -61,6 +61,7 @@ export function useComponentState({ peerPushCreditId, amountEffective, amountRaw, + exchangeBaseUrl } = hook.response; const effective = Amounts.parseOrThrow(amountEffective); @@ -80,6 +81,7 @@ export function useComponentState({ return { status: "ready", effective, + exchangeBaseUrl, raw, error: undefined, accept: { diff --git a/packages/taler-wallet-webextension/src/cta/TransferPickup/views.tsx b/packages/taler-wallet-webextension/src/cta/TransferPickup/views.tsx index 5dce2ce22..caa1b485a 100644 --- a/packages/taler-wallet-webextension/src/cta/TransferPickup/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/TransferPickup/views.tsx @@ -25,12 +25,14 @@ import { TransferPickupDetails, } from "../../wallet/Transaction.js"; import { State } from "./index.js"; +import { TermsOfService } from "../../components/TermsOfService/index.js"; export function ReadyView({ accept, summary, expiration, effective, + exchangeBaseUrl, raw, }: State.Ready): VNode { const { i18n } = useTranslationContext(); @@ -55,11 +57,13 @@ export function ReadyView({ /> </section> <section> - <Button variant="contained" color="success" onClick={accept.onClick}> - <i18n.Translate> - Receive {<Amount value={effective} />} - </i18n.Translate> - </Button> + <TermsOfService key="terms" exchangeUrl={exchangeBaseUrl} > + <Button variant="contained" color="success" onClick={accept.onClick}> + <i18n.Translate> + Receive {<Amount value={effective} />} + </i18n.Translate> + </Button> + </TermsOfService> </section> </Fragment> ); |