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
Support/live 1509 tezos tx flow cleanup #2297
Merged
cgrellard-ledger
merged 22 commits into
LL-7742
from
support/LIVE-1509-tezos-tx-flow-cleanup
Mar 17, 2022
+819
−22
Merged
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 5d68799
Convert SelectableAccountList to TypeScript
thomasrogerlux a06337e
Convert TouchHintCircle to TypeScript/StyledComponent
thomasrogerlux 0d0885d
Convert SelectableAccountsList to Styled Component
thomasrogerlux e428c26
Merge branch 'LL-7742' into support/LIVE-1622-tx-flow-cleanup
thomasrogerlux e9e9b3c
Fix add account select
thomasrogerlux cd54bb4
Fix hint position
thomasrogerlux a71e889
Fix styles to match
thomasrogerlux 0b6c11e
Cleanup press effect on account cards
thomasrogerlux 37cb8fe
Fix recipient input in send flow
thomasrogerlux e24ab29
Fix translations in device pairing
thomasrogerlux dfc3096
Merge branch 'LL-7742' into support/LIVE-1622-tx-flow-cleanup
thomasrogerlux 57cce40
Merge branch 'LL-7742' into support/LIVE-1622-tx-flow-cleanup
thomasrogerlux 4893518
LIVE-1509 Tezos Transactions screens cleaned and fixed + various smal…
cgrellard-ledger 39889a7
LIVE-1509 useless commentary removed from ValidateSuccess
cgrellard-ledger aa2df5c
LIVE-1509 SettingsRow horizontal padding removed
cgrellard-ledger 8b7f3bc
LIVE-1509 correct navigation put back in tezos delegation flow Summary
cgrellard-ledger c23776b
LIVE-1509 title text replace by log in ValidateSuccess and Tezos Star…
cgrellard-ledger 0339f0a
LIVE-1509 earn illustration added to tezos Started component
cgrellard-ledger 95b5134
LIVE-1509 some @flow removed and a few small improvements
cgrellard-ledger 0297bf9
Merge branch 'LL-7742' into support/LIVE-1509-tezos-tx-flow-cleanup
cgrellard-ledger e4eec70
LIVE-1509 Podfile.lock updated
cgrellard-ledger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
// @flow | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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