diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx b/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx index 40cfba3bc..f3172a741 100644 --- a/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx +++ b/packages/taler-wallet-webextension/src/components/TermsOfService/views.tsx @@ -23,7 +23,7 @@ import { Input, LinkSuccess, TermsOfServiceStyle, - WarningBox + WarningBox, } from "../../components/styled/index.js"; import { Button } from "../../mui/Button.js"; import { State } from "./index.js"; @@ -50,7 +50,9 @@ export function ShowButtonsAcceptedTosView({ </LinkSuccess> </section> {termsAccepted.button.onClick !== undefined && ( - <section style={{ justifyContent: "space-around", display: "flex" }}> + <section + style={{ justifyContent: "space-around", display: "flex" }} + > <CheckboxOutlined name="terms" enabled={termsAccepted.value} @@ -75,36 +77,9 @@ export function ShowButtonsNonAcceptedTosView({ terms, }: State.ShowButtonsNotAccepted): VNode { const { i18n } = useTranslationContext(); - // const ableToReviewTermsOfService = - // showingTermsOfService.button.onClick !== undefined; - - // if (!ableToReviewTermsOfService) { - // return ( - // <Fragment> - // {terms.status === ExchangeTosStatus.Pending && ( - // <section style={{ justifyContent: "space-around", display: "flex" }}> - // <WarningText> - // <i18n.Translate> - // Exchange doesn't have terms of service - // </i18n.Translate> - // </WarningText> - // </section> - // )} - // </Fragment> - // ); - // } return ( <Fragment> - {/* {terms.status === ExchangeTosStatus.NotFound && ( - <section style={{ justifyContent: "space-around", display: "flex" }}> - <WarningText> - <i18n.Translate> - Exchange doesn't have terms of service - </i18n.Translate> - </WarningText> - </section> - )} */} <section style={{ justifyContent: "space-around", display: "flex" }}> <Button variant="contained" @@ -124,11 +99,35 @@ export function ShowTosContentView({ terms, tosLang, tosFormat, + skipTos, }: State.ShowContent): VNode { const { i18n } = useTranslationContext(); - const ableToReviewTermsOfService = - termsAccepted.button.onClick !== undefined; + const ableToReviewTermsOfService = termsAccepted.button.onClick !== undefined; + + if (terms.status === ExchangeTosStatus.MissingTos) { + return ( + <section> + <section style={{ justifyContent: "space-around", display: "flex" }}> + <WarningBox> + <i18n.Translate> + The exchange doesn't have a terms of service. + </i18n.Translate> + </WarningBox> + </section> + <section style={{ justifyContent: "space-around", display: "flex" }}> + <Button + variant="contained" + color="success" + disabled={!skipTos.onClick} + onClick={skipTos.onClick} + > + <i18n.Translate>Skip it for now.</i18n.Translate> + </Button> + </section> + </section> + ); + } return ( <section> <Input style={{ display: "flex", justifyContent: "end" }}> @@ -206,20 +205,21 @@ export function ShowTosContentView({ </LinkSuccess> </section> )} - {termsAccepted.button.onClick && terms.status !== ExchangeTosStatus.Accepted && ( - <section style={{ justifyContent: "space-around", display: "flex" }}> - <CheckboxOutlined - name="terms" - enabled={termsAccepted.value} - label={ - <i18n.Translate> - I accept the exchange terms of service - </i18n.Translate> - } - onToggle={termsAccepted.button.onClick} - /> - </section> - )} + {termsAccepted.button.onClick && + terms.status !== ExchangeTosStatus.Accepted && ( + <section style={{ justifyContent: "space-around", display: "flex" }}> + <CheckboxOutlined + name="terms" + enabled={termsAccepted.value} + label={ + <i18n.Translate> + I accept the exchange terms of service + </i18n.Translate> + } + onToggle={termsAccepted.button.onClick} + /> + </section> + )} </section> ); } |