Skip to content

Commit

Permalink
Fix spacing and text size of Enter Amount Scene
Browse files Browse the repository at this point in the history
  • Loading branch information
paullinator committed Jan 17, 2024
1 parent fa3bd3f commit 073e8f9
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,6 @@ exports[`CryptoExchangeQuoteScreenComponent should render with loading props 1`]
"alignItems": "center",
"flexDirection": "row",
"justifyContent": "center",
"marginVertical": 11,
}
}
>
Expand Down Expand Up @@ -1353,10 +1352,10 @@ exports[`CryptoExchangeQuoteScreenComponent should render with loading props 1`]
"marginRight": 11,
"marginTop": 11,
"opacity": 1,
"paddingBottom": 22,
"paddingLeft": 22,
"paddingRight": 22,
"paddingTop": 22,
"paddingBottom": 11,
"paddingLeft": 11,
"paddingRight": 11,
"paddingTop": 11,
}
}
>
Expand Down
5 changes: 2 additions & 3 deletions src/components/cards/PoweredByCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const PoweredByCard = (props: Props) => {

return (
<View style={styles.cardContainer}>
<CardUi4 paddingRem={1} onPress={onPress}>
<CardUi4 paddingRem={0.5} onPress={onPress}>
<View style={styles.poweredByContainer}>
<FastImage style={styles.poweredByIcon} source={iconSrc} resizeMode="contain" />
<View style={styles.poweredByContainerColumn}>
Expand All @@ -44,8 +44,7 @@ const getStyles = cacheStyles((theme: Theme) => ({
cardContainer: {
alignItems: 'center',
flexDirection: 'row', // Make the card shrink
justifyContent: 'center',
marginVertical: theme.rem(0.5)
justifyContent: 'center'
},
poweredByContainerRow: {
flexDirection: 'row'
Expand Down
149 changes: 78 additions & 71 deletions src/plugins/gui/scenes/FiatPluginEnterAmountScene.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { useEffect } from 'react'
import { Image, Text, View } from 'react-native'
import { Image, Text, TextStyle, View } from 'react-native'

import { PoweredByCard } from '../../../components/cards/PoweredByCard'
import { SceneWrapper } from '../../../components/common/SceneWrapper'
Expand All @@ -9,6 +9,7 @@ import { cacheStyles, Theme, useTheme } from '../../../components/services/Theme
import { FilledTextInput } from '../../../components/themed/FilledTextInput'
import { MainButton } from '../../../components/themed/MainButton'
import { SceneHeader } from '../../../components/themed/SceneHeader'
import { SectionView } from '../../../components/ui4/SectionView'
import { useHandler } from '../../../hooks/useHandler'
import { lstrings } from '../../../locales/strings'
import { EdgeSceneProps } from '../../../types/routerTypes'
Expand Down Expand Up @@ -133,82 +134,88 @@ export const FiatPluginEnterAmountScene = React.memo((props: Props) => {
<SceneHeader style={styles.sceneHeader} title={headerTitle} underline withTopMargin>
{headerIcon}
</SceneHeader>
<View style={styles.container}>
<View style={styles.textFields}>
<FilledTextInput
numeric
maxDecimals={2}
autoCorrect={false}
autoFocus
autoCapitalize="none"
keyboardType="decimal-pad"
placeholder={label1}
onChangeText={handleChangeText1}
onSubmitEditing={handleSubmit}
showSpinner={spinner1}
value={value1 ?? '0'}
/>
<FilledTextInput
numeric
maxDecimals={6}
autoCorrect={false}
autoFocus={false}
autoCapitalize="none"
keyboardType="decimal-pad"
placeholder={label2}
onChangeText={handleChangeText2}
onSubmitEditing={handleSubmit}
showSpinner={spinner2}
value={value2 ?? '0'}
/>
<SectionView>
<View style={styles.container}>
<View style={styles.textFields}>
<FilledTextInput
numeric
maxDecimals={2}
autoCorrect={false}
autoFocus
autoCapitalize="none"
keyboardType="decimal-pad"
placeholder={label1}
onChangeText={handleChangeText1}
onSubmitEditing={handleSubmit}
showSpinner={spinner1}
textsizeRem={1.5}
value={value1 ?? '0'}
vertical={0.5}
/>
<FilledTextInput
numeric
maxDecimals={6}
autoCorrect={false}
autoFocus={false}
autoCapitalize="none"
keyboardType="decimal-pad"
placeholder={label2}
onChangeText={handleChangeText2}
onSubmitEditing={handleSubmit}
showSpinner={spinner2}
textsizeRem={1.5}
value={value2 ?? '0'}
vertical={0.5}
/>
</View>
{statusText != null ? <Text style={statusTextStyle}>{statusText.content}</Text> : null}
{poweredBy != null ? <PoweredByCard iconUri={poweredByIconPath} poweredByText={poweredBy.poweredByText} onPress={handlePoweredByPress} /> : null}
<MainButton disabled={spinner1 || spinner2} label={lstrings.string_next_capitalized} marginRem={[0.25, 0]} onPress={handleSubmit} />
</View>
{statusText != null ? <Text style={statusTextStyle}>{statusText.content}</Text> : null}
{poweredBy != null ? <PoweredByCard iconUri={poweredByIconPath} poweredByText={poweredBy.poweredByText} onPress={handlePoweredByPress} /> : null}
<MainButton disabled={spinner1 || spinner2} label={lstrings.string_next_capitalized} marginRem={[1, 0]} type="secondary" onPress={handleSubmit} />
</View>
</SectionView>
</SceneWrapper>
)
})

const getStyles = cacheStyles((theme: Theme) => ({
sceneHeader: {
flexDirection: 'row',
justifyContent: 'flex-start',
alignItems: 'center'
},
container: {
alignItems: 'center',
paddingTop: theme.rem(0.5),
width: '100%'
},
textFields: {
flexDirection: 'column',
minWidth: theme.rem(15),
maxWidth: theme.rem(20)
},
text: {
color: theme.primaryText,
fontFamily: theme.fontFaceMedium,
fontSize: theme.rem(1),
includeFontPadding: false
},
textWarning: {
color: theme.warningText,
const getStyles = cacheStyles((theme: Theme) => {
const textCommon: TextStyle = {
fontFamily: theme.fontFaceMedium,
fontSize: theme.rem(1),
includeFontPadding: false
},
textError: {
color: theme.dangerText,
fontFamily: theme.fontFaceMedium,
fontSize: theme.rem(1),
includeFontPadding: false
},
icon: {
height: theme.rem(1.5),
width: theme.rem(1.5),
marginRight: theme.rem(0.5),
marginLeft: theme.rem(0.5),
resizeMode: 'contain'
}
}))
return {
sceneHeader: {
flexDirection: 'row',
justifyContent: 'flex-start',
alignItems: 'center'
},
container: {
alignItems: 'center',
paddingTop: theme.rem(0.5),
width: '100%'
},
textFields: {
flexDirection: 'column',
width: theme.rem(15)
},
text: {
...textCommon,
color: theme.primaryText
},
textWarning: {
...textCommon,
color: theme.warningText
},
textError: {
...textCommon,
color: theme.dangerText
},
icon: {
height: theme.rem(1.5),
width: theme.rem(1.5),
marginRight: theme.rem(0.5),
marginLeft: theme.rem(0.5),
resizeMode: 'contain'
}
}
})

0 comments on commit 073e8f9

Please sign in to comment.