-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4d6cc7
commit dfc6312
Showing
16 changed files
with
435 additions
and
13 deletions.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
"live-mobile": patch | ||
--- | ||
|
||
Add the show qr code implementation for WS flow |
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 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 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 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 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 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 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
46 changes: 46 additions & 0 deletions
46
...edger-live-mobile/src/newArch/features/WalletSync/components/Synchronize/DrawerHeader.tsx
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,46 @@ | ||
import React from "react"; | ||
import { Flex, Icons, Text } from "@ledgerhq/native-ui"; | ||
import { useTheme } from "styled-components/native"; | ||
import { useTranslation } from "react-i18next"; | ||
import { TouchableOpacity } from "react-native"; | ||
|
||
type Props = { | ||
onClose: () => void; | ||
}; | ||
|
||
const DrawerHeader: React.FC<Props> = ({ onClose }) => { | ||
const { colors } = useTheme(); | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<Flex | ||
flexDirection="row" | ||
justifyContent="space-between" | ||
alignItems="center" | ||
width="100%" | ||
pt={16} | ||
pl={16} | ||
pr={16} | ||
> | ||
<Flex flex={1} /> | ||
<Text fontSize={16} fontWeight="semiBold" color={colors.neutral.c100}> | ||
{t("walletSync.walletSyncActivated.synchronize.title")} | ||
</Text> | ||
<Flex flex={1} alignItems="flex-end"> | ||
<TouchableOpacity onPress={onClose}> | ||
<Flex | ||
justifyContent="center" | ||
alignItems="center" | ||
p={3} | ||
borderRadius={32} | ||
backgroundColor={colors.opacityDefault.c10} | ||
> | ||
<Icons.Close size={"XS"} color={colors.neutral.c100} /> | ||
</Flex> | ||
</TouchableOpacity> | ||
</Flex> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default DrawerHeader; |
77 changes: 77 additions & 0 deletions
77
apps/ledger-live-mobile/src/newArch/features/WalletSync/components/Synchronize/QrCode.tsx
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,77 @@ | ||
import React from "react"; | ||
import { Flex, Box, Text, NumberedList } from "@ledgerhq/native-ui"; | ||
import styled, { useTheme } from "styled-components/native"; | ||
import QRCode from "react-native-qrcode-svg"; | ||
import getWindowDimensions from "~/logic/getWindowDimensions"; | ||
import { Trans, useTranslation } from "react-i18next"; | ||
|
||
const Italic = styled(Text)` | ||
font-style: italic; | ||
`; | ||
// Won't work since we don't have inter italic font | ||
|
||
type Props = { | ||
qrCodeValue: string; | ||
}; | ||
|
||
const QrCode = ({ qrCodeValue }: Props) => { | ||
const { colors } = useTheme(); | ||
const { width } = getWindowDimensions(); | ||
const { t } = useTranslation(); | ||
|
||
const QRSize = Math.round(width - 48); | ||
const maxQRCodeSize = 280 - 15.36 * 2; | ||
const QRCodeSize = Math.min(QRSize - 15.36, maxQRCodeSize); | ||
|
||
const steps = [ | ||
{ description: t("walletSync.synchronize.qrCode.show.explanation.steps.step1") }, | ||
{ | ||
description: ( | ||
<Text variant="body" flex={1} ml={12} fontSize={14} color={colors.opacityDefault.c70}> | ||
<Trans | ||
i18nKey="walletSync.synchronize.qrCode.show.explanation.steps.step2" | ||
components={[ | ||
<Italic key={0} color={colors.opacityDefault.c70} />, | ||
<Text key={1} color={colors.opacityDefault.c30} />, | ||
]} | ||
/> | ||
</Text> | ||
), | ||
}, | ||
{ description: t("walletSync.synchronize.qrCode.show.explanation.steps.step3") }, | ||
]; | ||
|
||
return ( | ||
<Flex flexDirection={"column"} rowGap={50} alignItems={"center"} width={"100%"}> | ||
<Flex | ||
alignItems={"center"} | ||
width={QRSize} | ||
height={QRSize} | ||
maxWidth={280} | ||
maxHeight={280} | ||
borderRadius={11.52} | ||
background={"#fff"} | ||
justifyContent={"center"} | ||
> | ||
<QRCode value={qrCodeValue} logo={require("./logo.png")} logoSize={65} size={QRCodeSize} /> | ||
</Flex> | ||
<Box | ||
px={16} | ||
pt={24} | ||
width={"100%"} | ||
background={colors.opacityDefault.c05} | ||
borderRadius={24} | ||
display={"flex"} | ||
flexDirection={"column"} | ||
rowGap={24} | ||
> | ||
<Text variant="h4" fontSize={18} color={colors.neutral.c100}> | ||
{t("walletSync.synchronize.qrCode.show.explanation.title")} | ||
</Text> | ||
<NumberedList maxHeight={180} items={steps} /> | ||
</Box> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default QrCode; |
Oops, something went wrong.