diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/AddExchange')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts | 3 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/AddExchange/views.tsx | 44 |
2 files changed, 23 insertions, 24 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts b/packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts index f16d3929d..69f2a6028 100644 --- a/packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts +++ b/packages/taler-wallet-webextension/src/wallet/AddExchange/index.ts @@ -22,6 +22,7 @@ import { TextFieldHandler } from "../../mui/handlers.js"; import { compose, StateViewMap } from "../../utils/index.js"; import { useComponentState } from "./state.js"; import { ConfirmView, VerifyView } from "./views.js"; +import { ExchangeListItem } from "@gnu-taler/taler-util"; export interface Props { currency?: string; @@ -64,7 +65,7 @@ export namespace State { url: TextFieldHandler, knownExchanges: URL[], - result: HttpResponse<{ currency_specification: {currency: string}, version: string}, unknown> | undefined, + result: HttpResponse<{ currency_specification: { currency: string }, version: string }, unknown> | undefined, expectedCurrency: string | undefined, } } diff --git a/packages/taler-wallet-webextension/src/wallet/AddExchange/views.tsx b/packages/taler-wallet-webextension/src/wallet/AddExchange/views.tsx index 87ea5eae3..53a46fe02 100644 --- a/packages/taler-wallet-webextension/src/wallet/AddExchange/views.tsx +++ b/packages/taler-wallet-webextension/src/wallet/AddExchange/views.tsx @@ -143,7 +143,7 @@ export function VerifyView({ } e.preventDefault() }}> - {ex.href}</a></li> + {ex.href}</a></li> })} </ul> </section> @@ -159,8 +159,6 @@ export function ConfirmView({ }: State.Confirm): VNode { const { i18n } = useTranslationContext(); - const [accepted, setAccepted] = useState(false); - return ( <Fragment> <section> @@ -175,27 +173,27 @@ export function ConfirmView({ </div> </section> - <TermsOfService key="terms" exchangeUrl={url} onChange={setAccepted} /> - <footer> - <Button - key="cancel" - variant="contained" - color="secondary" - onClick={onCancel} - > - <i18n.Translate>Cancel</i18n.Translate> - </Button> - <Button - key="add" - variant="contained" - color="success" - disabled={!accepted} - onClick={onConfirm} - > - <i18n.Translate>Add exchange</i18n.Translate> - </Button> - </footer> + <TermsOfService key="terms" exchangeUrl={url} > + <footer> + <Button + key="cancel" + variant="contained" + color="secondary" + onClick={onCancel} + > + <i18n.Translate>Cancel</i18n.Translate> + </Button> + <Button + key="add" + variant="contained" + color="success" + onClick={onConfirm} + > + <i18n.Translate>Add exchange</i18n.Translate> + </Button> + </footer> + </TermsOfService> </Fragment> ); } |