diff --git a/src/backup/BackupPhraseContainer.tsx b/src/backup/BackupPhraseContainer.tsx index 9403253bf75..f802354e081 100644 --- a/src/backup/BackupPhraseContainer.tsx +++ b/src/backup/BackupPhraseContainer.tsx @@ -1,7 +1,7 @@ import Clipboard from '@react-native-clipboard/clipboard' import * as React from 'react' import { WithTranslation } from 'react-i18next' -import { StyleSheet, Text, TextInput, View, ViewStyle } from 'react-native' +import { StyleSheet, Text, TextInput, View, ViewStyle, useWindowDimensions } from 'react-native' import { isValidBackupPhrase } from 'src/backup/utils' import Touchable from 'src/components/Touchable' import withTextInputPasteAware from 'src/components/WithTextInputPasteAware' @@ -9,6 +9,7 @@ import { withTranslation } from 'src/i18n' import colors from 'src/styles/colors' import fontStyles from 'src/styles/fonts' import { vibrateInformative } from 'src/styles/hapticFeedback' +import { Spacing } from 'src/styles/styles' import Logger from 'src/utils/Logger' const PhraseInput = withTextInputPasteAware(TextInput, { top: undefined, right: 12, bottom: 12 }) @@ -18,17 +19,23 @@ type TwelveWordTableProps = { } function TwelveWordTable({ words }: TwelveWordTableProps) { + const { fontScale } = useWindowDimensions() return ( - <> + {words.map((word, index) => ( - - {index + 1} - + 1.5 ? { width: '50%' } : { width: '33%' }]} + > + + {index + 1} + + {word} ))} - + ) } @@ -153,20 +160,20 @@ const styles = StyleSheet.create({ indexText: { ...fontStyles.regular, color: colors.gray4, - marginRight: 8, - lineHeight: 24, }, - wordText: { - ...fontStyles.regular, - lineHeight: 24, + twelveWordTable: { + flexDirection: 'row', + flexWrap: 'wrap', + marginHorizontal: Spacing.Small12, }, - indexWordContainer: { - flexGrow: 1, - flexShrink: 1, - flexBasis: '30%', + wordContainer: { flexDirection: 'row', + gap: Spacing.Smallest8, + alignItems: 'center', marginVertical: 11, - marginLeft: '3%', + }, + wordText: { + ...fontStyles.regular, }, phraseContainer: { flexWrap: 'wrap', diff --git a/src/backup/__snapshots__/BackupPhraseContainer.test.tsx.snap b/src/backup/__snapshots__/BackupPhraseContainer.test.tsx.snap index 57b4a2863af..769431ecd77 100644 --- a/src/backup/__snapshots__/BackupPhraseContainer.test.tsx.snap +++ b/src/backup/__snapshots__/BackupPhraseContainer.test.tsx.snap @@ -122,458 +122,528 @@ exports[`BackupPhraseContainer renders correctly for readonly backup 12-word phr - - 1 - - - prosper - - - - + 1 + + - 2 - - + prosper + + + - winner - - - - - 3 - - + 2 + + - find - - - - + winner + + + - 4 - - - donate - - - - + 3 + + - 5 - - + find + + + - tape - - - - - 6 - - + 4 + + - history - - - - + donate + + + - 7 - - - measure - - - - + 5 + + - 8 - - + tape + + + - umbrella - - - - - 9 - - + 6 + + - agent - - - - + history + + + - 10 - - + 7 + + + measure + + + - patrol - - - - + 8 + + + umbrella + + + - 11 - - + 9 + + + agent + + + - want - - - - + 10 + + + patrol + + + - 12 - - + 11 + + + want + + + - rhythm - + + 12 + + + rhythm + +