Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Support/live 1509 tezos tx flow cleanup #2297

Merged
merged 22 commits into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
034d7ae
Fix text color in create modal
thomasrogerlux Mar 8, 2022
5d68799
Convert SelectableAccountList to TypeScript
thomasrogerlux Mar 8, 2022
a06337e
Convert TouchHintCircle to TypeScript/StyledComponent
thomasrogerlux Mar 8, 2022
0d0885d
Convert SelectableAccountsList to Styled Component
thomasrogerlux Mar 8, 2022
e428c26
Merge branch 'LL-7742' into support/LIVE-1622-tx-flow-cleanup
thomasrogerlux Mar 9, 2022
e9e9b3c
Fix add account select
thomasrogerlux Mar 10, 2022
cd54bb4
Fix hint position
thomasrogerlux Mar 10, 2022
a71e889
Fix styles to match
thomasrogerlux Mar 10, 2022
0b6c11e
Cleanup press effect on account cards
thomasrogerlux Mar 10, 2022
37cb8fe
Fix recipient input in send flow
thomasrogerlux Mar 10, 2022
e24ab29
Fix translations in device pairing
thomasrogerlux Mar 10, 2022
dfc3096
Merge branch 'LL-7742' into support/LIVE-1622-tx-flow-cleanup
thomasrogerlux Mar 14, 2022
57cce40
Merge branch 'LL-7742' into support/LIVE-1622-tx-flow-cleanup
thomasrogerlux Mar 14, 2022
4893518
LIVE-1509 Tezos Transactions screens cleaned and fixed + various smal…
cgrellard-ledger Mar 16, 2022
39889a7
LIVE-1509 useless commentary removed from ValidateSuccess
cgrellard-ledger Mar 16, 2022
aa2df5c
LIVE-1509 SettingsRow horizontal padding removed
cgrellard-ledger Mar 16, 2022
8b7f3bc
LIVE-1509 correct navigation put back in tezos delegation flow Summary
cgrellard-ledger Mar 16, 2022
c23776b
LIVE-1509 title text replace by log in ValidateSuccess and Tezos Star…
cgrellard-ledger Mar 16, 2022
0339f0a
LIVE-1509 earn illustration added to tezos Started component
cgrellard-ledger Mar 16, 2022
95b5134
LIVE-1509 some @flow removed and a few small improvements
cgrellard-ledger Mar 17, 2022
0297bf9
Merge branch 'LL-7742' into support/LIVE-1509-tezos-tx-flow-cleanup
cgrellard-ledger Mar 17, 2022
e4eec70
LIVE-1509 Podfile.lock updated
cgrellard-ledger Mar 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,33 @@ PODS:
- CocoaAsyncSocket (7.6.5)
- djinni_objc (4.19.1)
- DoubleConversion (1.1.6)
- EXApplication (4.0.1):
- EXApplication (4.0.2):
- ExpoModulesCore
- EXBarCodeScanner (11.1.2):
- EXBarCodeScanner (11.2.1):
- EXImageLoader
- ExpoModulesCore
- ZXingObjC/OneD
- ZXingObjC/PDF417
- EXCamera (12.0.3):
- EXCamera (12.1.2):
- ExpoModulesCore
- EXConstants (12.1.3):
- EXConstants (13.0.2):
- ExpoModulesCore
- EXErrorRecovery (3.0.4):
- EXErrorRecovery (3.0.5):
- ExpoModulesCore
- EXFileSystem (13.0.3):
- EXFileSystem (13.1.4):
- ExpoModulesCore
- EXFont (10.0.4):
- EXFont (10.0.5):
- ExpoModulesCore
- EXImageLoader (3.0.0):
- EXImageLoader (3.1.1):
- ExpoModulesCore
- React-Core
- EXKeepAwake (10.0.1):
- EXKeepAwake (10.0.2):
- ExpoModulesCore
- Expo (43.0.4):
- Expo (44.0.6):
- ExpoModulesCore
- ExpoModulesCore (0.4.9):
- ExpoModulesCore (0.6.5):
- React-Core
- ReactCommon/turbomodule/core
- FBLazyVector (0.67.3)
- FBReactNativeSpec (0.67.3):
- RCT-Folly (= 2021.06.28.00-v2)
Expand Down Expand Up @@ -857,17 +858,17 @@ SPEC CHECKSUMS:
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
djinni_objc: 54ab066f337b37aceaba6d020b1e6964eead00ba
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
EXApplication: bdc8dc27713235565da1029a34385229f31b8e08
EXBarCodeScanner: cc450529b9c5e02dd9e2498cc0dddf153f120dfe
EXCamera: 03d69135ceb6f5f18f37b63eddb63d7643b65c42
EXConstants: 6d585d93723b18d7a8c283591a335609e3bc153e
EXErrorRecovery: deea88a01d38f8b1c1181b4e1d179b0ba0e4bb5b
EXFileSystem: 99aac7962c11c680681819dd9cbca24e20e5b1e7
EXFont: 1fb13af43dc517c01c0ff21a6e32f9f9bf2ea602
EXImageLoader: 939451be6f7b731aaa6588920b90743f20121a4d
EXKeepAwake: b571c2ad8323b2fced6e907766e2549f75119471
Expo: 363a3f3c60d5a1d4f8badb29a869005487f2d9e4
ExpoModulesCore: e41ed0b72daeac74731816ad7997d639f0115a9d
EXApplication: 54fe5bd6268d697771645e8f1aef8b806a65247a
EXBarCodeScanner: e5ca0062d8ad1c4c1d2e386d6a308d5a32213020
EXCamera: 4a0d00d6d1e4703c31a75514d8bc804a2eab27bd
EXConstants: 88bf79622fbd9b476c96d8ec57fe97ca44fe8e3c
EXErrorRecovery: b0d7582714a2cc896e94a2308a356f94dbf14ef7
EXFileSystem: 08a3033ac372b6346becf07839e1ccef26fb1058
EXFont: 2597c10ac85a69d348d44d7873eccf5a7576ef5e
EXImageLoader: 347b72c2ec2df65120ccec40ea65a4c4f24317ff
EXKeepAwake: bf48d7f740a5cd2befed6cf9a49911d385c6c47d
Expo: 534e51e607aba8229293297da5585f4b26f50fa1
ExpoModulesCore: 32c0ccb47f477d330ee93db72505380adf0de09a
FBLazyVector: 808f741ddb0896a20e5b98cc665f5b3413b072e2
FBReactNativeSpec: 94473205b8741b61402e8c51716dea34aa3f5b2f
Firebase: 44dd9724c84df18b486639e874f31436eaa9a20c
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@ledgerhq/hw-transport-http": "6.24.1",
"@ledgerhq/live-common": "^21.33.0",
"@ledgerhq/logs": "6.10.0",
"@ledgerhq/native-ui": "^0.7.3",
"@ledgerhq/native-ui": "^0.7.6",
"@ledgerhq/react-native-hid": "6.24.1",
"@ledgerhq/react-native-hw-transport-ble": "6.25.1",
"@ledgerhq/react-native-ledger-core": "4.19.1",
Expand Down
91 changes: 48 additions & 43 deletions src/components/AccountCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getTagDerivationMode } from "@ledgerhq/live-common/lib/derivation";
import { Account, CryptoCurrency } from "@ledgerhq/live-common/lib/types";
import { Flex, Tag, Text } from "@ledgerhq/native-ui";
import { useTheme } from "styled-components/native";
import { TouchableOpacity } from "react-native-gesture-handler";

import Card, { Props as CardProps } from "./Card";
import CurrencyIcon from "./CurrencyIcon";
Expand Down Expand Up @@ -42,56 +43,60 @@ const AccountCard = ({
getTagDerivationMode(currency as CryptoCurrency, account.derivationMode);

return (
<Card
<TouchableOpacity
activeOpacity={0.6}
onPress={!disabled ? onPress : undefined}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here since it's now a TouchableOpacity you should simply use the disabled prop https://reactnative.dev/docs/touchablewithoutfeedback#disabled

flexDirection="row"
paddingY={4}
alignItems="center"
backgroundColor="transparent"
style={style}
{...props}
>
<CurrencyIcon
currency={currency}
color={disabled ? colors.neutral.c40 : undefined}
size={32}
circle
/>
<Flex
flexGrow={1}
flexShrink={1}
marginLeft={3}
<Card
flexDirection="row"
paddingY={4}
alignItems="center"
backgroundColor="transparent"
style={style}
{...props}
>
<Flex flexShrink={1}>
<Text
variant="paragraph"
fontWeight="semiBold"
numberOfLines={1}
color={disabled ? "neutral.c50" : "neutral.c100"}
flexShrink={1}
>
{getAccountName(account)}
<CurrencyIcon
currency={currency}
color={disabled ? colors.neutral.c40 : undefined}
size={32}
circle
/>
<Flex
flexGrow={1}
flexShrink={1}
marginLeft={3}
flexDirection="row"
alignItems="center"
>
<Flex flexShrink={1}>
<Text
variant="paragraph"
fontWeight="semiBold"
numberOfLines={1}
color={disabled ? "neutral.c50" : "neutral.c100"}
flexShrink={1}
>
{getAccountName(account)}
</Text>
{AccountSubTitle}
</Flex>
{tag && <Tag marginLeft={5}>{tag}</Tag>}
</Flex>
<Flex marginLeft={5} alignItems="flex-end">
<Text variant="small" fontWeight="medium" color="neutral.c70">
<CurrencyUnitValue
showCode
unit={unit}
value={
useFullBalance
? account.balance
: getAccountSpendableBalance(account)
}
/>
</Text>
{AccountSubTitle}
</Flex>
{tag && <Tag marginLeft={5}>{tag}</Tag>}
</Flex>
<Flex marginLeft={5} alignItems="flex-end">
<Text variant="small" fontWeight="medium" color="neutral.c70">
<CurrencyUnitValue
showCode
unit={unit}
value={
useFullBalance
? account.balance
: getAccountSpendableBalance(account)
}
/>
</Text>
</Flex>
</Card>
</Card>
</TouchableOpacity>
);
};

Expand Down
2 changes: 0 additions & 2 deletions src/components/AccountList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ const AccountList = ({
const renderItem = ({ item: result }: { item: SearchResult }) => {
const { account } = result;

console.log(result.account.id);

return (
<Flex>
<Flex
Expand Down
2 changes: 1 addition & 1 deletion src/components/CameraScreen/QRCodeBottomLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function QrCodeBottomLayer({ progress, liveQrCode }: Props) {
</Text>
</Flex>
}
></Alert>
/>
</Flex>
</Flex>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/ExternalLink.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import React from "react";
import { StyleSheet } from "react-native";
import { useTheme } from "@react-navigation/native";
import { useTheme } from "styled-components/native";
import LText from "./LText";
import Touchable from "./Touchable";
import ExternalLink from "../icons/ExternalLink";
Expand Down Expand Up @@ -29,7 +29,7 @@ const Link = ({
fontSize = 12,
}: Props) => {
const { colors } = useTheme();
const c = color || colors.live;
const c = color || colors.primary.c80;
return (
<Touchable
event={event}
Expand Down
158 changes: 158 additions & 0 deletions src/components/InfoModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
// @flow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove this


import React, { memo } from "react";
import { StyleSheet, View } from "react-native";
import { Trans } from "react-i18next";

import { useTheme } from "@react-navigation/native";
import { Icons, IconBox, Flex, Button } from "@ledgerhq/native-ui";
import BottomModal from "./BottomModal";
import LText from "./LText";
import IconArrowRight from "../icons/ArrowRight";
import type { Props as ModalProps } from "./BottomModal";

type BulletItem = {
key: string,
val: React.ReactNode,
};

type InfoModalProps = ModalProps & {
id?: string,
Copy link
Contributor

@ofreyssinet-ledger ofreyssinet-ledger Mar 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably eslint cries here when it sees "," instead of ";" no?

title?: React.ReactNode,
desc?: React.ReactNode,
bullets?: BulletItem[],
Icon?: React.ReactNode,
withCancel?: boolean,
onContinue?: () => void,
children?: React.ReactNode,
confirmLabel?: React.ReactNode,
confirmProps?: any,
};

const InfoModal = ({
isOpened,
onClose,
id,
title,
desc,
bullets,
Icon = Icons.InfoMedium,
withCancel,
onContinue,
children,
confirmLabel,
confirmProps,
style,
containerStyle,
}: InfoModalProps) => (
<BottomModal
id={id}
isOpened={isOpened}
onClose={onClose}
style={[styles.modal, style || {}]}
>
<Flex alignItems="center">
<IconBox Icon={Icon} color="primary.c80" boxSize={64} iconSize={24} />
{title ? (
<LText style={styles.modalTitle} semiBold>
{title}
</LText>
) : null}

{desc ? (
<LText style={styles.modalDesc} color="smoke">
{desc}
</LText>
) : null}
{bullets ? (
<View style={styles.bulletsContainer}>
{bullets.map(b => (
<BulletLine key={b.key}>{b.val}</BulletLine>
))}
</View>
) : null}
<View
style={[
!title && !desc && !bullets ? styles.childrenContainer : null,
containerStyle,
]}
>
{children}
</View>
</Flex>

<Flex pt={6}>
{withCancel ? (
<Button
event={(id || "") + "InfoModalClose"}
type={undefined}
onPress={onClose}
mt={7}
>
<Trans i18nKey="common.cancel" />
</Button>
) : null}
<Button
event={(id || "") + "InfoModalGotIt"}
type="main"
onPress={onContinue || onClose}
{...confirmProps}
mt={7}
>
{confirmLabel || <Trans i18nKey="common.gotit" />}
</Button>
</Flex>
</BottomModal>
);

function BulletLine({ children }: { children: any }) {
const { colors } = useTheme();
return (
<View style={styles.bulletLine}>
<IconArrowRight size={16} color={colors.smoke} />
<LText style={styles.bulletLineText} color="smoke">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use colors from the new design system here?

{children}
</LText>
</View>
);
}

const styles = StyleSheet.create({
modal: {
paddingHorizontal: 16,
paddingTop: 24,
alignItems: "center",
},
modalTitle: {
marginVertical: 16,
fontSize: 14,
lineHeight: 21,
},
modalDesc: {
textAlign: "center",

marginBottom: 24,
},
bulletsContainer: {
alignSelf: "flex-start",
},
bulletLine: {
flexDirection: "row",
alignItems: "center",
marginBottom: 8,
},
bulletLineText: {
marginLeft: 4,
textAlign: "left",
},
childrenContainer: {
paddingTop: 24,
},
footer: {
alignSelf: "stretch",
paddingTop: 24,
flexDirection: "row",
},
});

export default memo<InfoModalProps>(InfoModal);
Loading