Skip to content

Commit

Permalink
fix(swap): tx confirmation screen item alignment (#3261)
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss authored May 16, 2024
1 parent c1600ba commit 763b1de
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 33 deletions.
72 changes: 40 additions & 32 deletions apps/wallet-mobile/src/components/AmountItem/AmountItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,40 +99,24 @@ export const AmountItem = ({
}

const Left = ({style, ...props}: ViewProps) => <View style={style} {...props} />
const Middle = ({style, ...props}: ViewProps) => (
<View style={[style, {flex: 1, justifyContent: 'center', paddingHorizontal: 8}]} {...props} />
)
const Right = ({style, ...props}: ViewProps) => <View style={style} {...props} />
const Middle = ({style, ...props}: ViewProps) => {
const {styles} = useStyles()

return <View style={[style, styles.middle]} {...props} />
}
const Right = ({style, ...props}: ViewProps) => {
const {styles} = useStyles()

return <View style={[style, styles.right]} {...props} />
}

export const AmountItemPlaceholder = ({style}: ViewProps) => {
const {colors} = useStyles()
const {styles} = useStyles()
return (
<View
style={[
style,
{
display: 'flex',
flexDirection: 'row',
gap: 12,
height: 56,
},
]}
>
<View
style={{
backgroundColor: colors.background,
borderRadius: 8,
flexGrow: 3,
}}
/>

<View
style={{
backgroundColor: colors.background,
borderRadius: 8,
flexGrow: 1,
}}
/>
<View style={[style, styles.placeholder]}>
<View style={styles.placeholderElement1} />

<View style={styles.placeholderElement2} />
</View>
)
}
Expand All @@ -146,6 +130,31 @@ const useStyles = () => {
justifyContent: 'space-between',
alignItems: 'center',
},
placeholder: {
display: 'flex',
flexDirection: 'row',
gap: 12,
height: 56,
},
placeholderElement1: {
backgroundColor: color.gray[200],
borderRadius: 8,
flexGrow: 3,
},
placeholderElement2: {
backgroundColor: color.gray[200],
borderRadius: 8,
flexGrow: 1,
},
middle: {
flex: 1,
justifyContent: 'center',
paddingHorizontal: 8,
},
right: {
flexDirection: 'column',
alignItems: 'flex-end',
},
name: {
color: color.gray[900],
fontSize: 16,
Expand Down Expand Up @@ -174,7 +183,6 @@ const useStyles = () => {

const colors = {
text: color.gray[900],
background: color.gray[200],
icon: color.secondary[600],
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const TransactionSummary = () => {
<View style={styles.card}>
<Text style={styles.cardText}>{strings.total}</Text>

<View>
<View style={styles.total}>
<Text style={[styles.cardText, styles.cardTextValue]}>{formattedSellText}</Text>

{!isSellPrimary && (
Expand Down Expand Up @@ -336,6 +336,10 @@ const useStyles = () => {
bold: {
...typography['body-2-m-medium'],
},
total: {
flexDirection: 'column',
alignItems: 'flex-end',
},
})

return styles
Expand Down

0 comments on commit 763b1de

Please sign in to comment.