This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add terms of use update pop-up * Put text in proper translation file * Remove useless logger * Update terms of use * Make the ToU update popup blocking for the user * Remove old localized ToU from the repository * Update settings ToU entry to open ToU in browser * Remove old ToU implementation Co-authored-by: Valentin D. Pinkman <valentin.d.pinkman@hey.com>
- Loading branch information
1 parent
288f00e
commit d358b9a
Showing
11 changed files
with
298 additions
and
1,077 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React, { ReactNode, useCallback } from "react"; | ||
import { Linking } from "react-native"; | ||
import { useTranslation } from "react-i18next"; | ||
import { BottomDrawer, Flex, Icons, Link, Text } from "@ledgerhq/native-ui"; | ||
import styled from "styled-components/native"; | ||
|
||
import { useLocalizedTermsUrl, useTermsAccept } from "../logic/terms"; | ||
import Button from "./Button"; | ||
import Alert from "./Alert"; | ||
|
||
const Description = styled(Text).attrs(() => ({ | ||
color: "neutral.c70", | ||
}))``; | ||
|
||
const Divider = styled(Flex).attrs(() => ({ | ||
my: 4, | ||
height: 1, | ||
backgroundColor: "neutral.c40", | ||
}))``; | ||
|
||
const Update = ({ children }: { children: ReactNode }) => ( | ||
<Flex flexDirection="row"> | ||
<Description mr={2}>{"•"}</Description> | ||
<Description>{children}</Description> | ||
</Flex> | ||
); | ||
|
||
const CheckTermOfUseUpdateModal = () => { | ||
const { t } = useTranslation(); | ||
const [accepted, accept] = useTermsAccept(); | ||
const termsUrl = useLocalizedTermsUrl(); | ||
|
||
const handleLink = useCallback(() => { | ||
Linking.openURL(termsUrl); | ||
}, [termsUrl]); | ||
|
||
return ( | ||
<BottomDrawer | ||
id="TermOfUseUpdate" | ||
noCloseButton={true} | ||
title={t("updatedTerms.title")} | ||
isOpen={!accepted} | ||
> | ||
<Flex mb={6}> | ||
<Description>{t("updatedTerms.body.intro")}</Description> | ||
<Flex my={4}> | ||
<Update>{t("updatedTerms.body.bulletPoints.0")}</Update> | ||
<Update>{t("updatedTerms.body.bulletPoints.1")}</Update> | ||
<Update>{t("updatedTerms.body.bulletPoints.2")}</Update> | ||
</Flex> | ||
<Description>{t("updatedTerms.body.agreement")}</Description> | ||
</Flex> | ||
<Alert type="help" noIcon> | ||
<Link type="color" onPress={handleLink} Icon={Icons.ExternalLinkMedium}> | ||
{t("updatedTerms.link")} | ||
</Link> | ||
</Alert> | ||
<Divider /> | ||
<Button type="main" outline={false} onPress={accept}> | ||
{t("updatedTerms.cta")} | ||
</Button> | ||
</BottomDrawer> | ||
); | ||
}; | ||
|
||
export default CheckTermOfUseUpdateModal; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.