diff --git a/src/components/LabelWithInfo.tsx b/src/components/LabelWithInfo.tsx index 329a6730f84..bbfe092fcdd 100644 --- a/src/components/LabelWithInfo.tsx +++ b/src/components/LabelWithInfo.tsx @@ -14,11 +14,13 @@ export function LabelWithInfo({ iconSize = 16, testID, style, + numberOfLines, }: { label: string onPress?: () => void labelStyle?: StyleProp iconSize?: number + numberOfLines?: number | undefined testID?: string style?: StyleProp }) { @@ -30,7 +32,7 @@ export function LabelWithInfo({ disabled={!onPress} > <> - + {label} {onPress && } diff --git a/src/earn/EarnEnterAmount.tsx b/src/earn/EarnEnterAmount.tsx index bcb276970c8..2700e29543c 100644 --- a/src/earn/EarnEnterAmount.tsx +++ b/src/earn/EarnEnterAmount.tsx @@ -574,6 +574,7 @@ function TransactionWithdrawDetails({ feeDetailsBottomSheetRef?.current?.snapToIndex(0) }} testID="LabelWithInfo/FeeLabel" + numberOfLines={1} /> )} - + - + {earnItem.label} - - - {t('earnFlow.poolInfoScreen.lineItemAmountDisplay', { - localCurrencySymbol, - localCurrencyAmount: formatValueToDisplay(amountInLocalCurrency), - cryptoAmount: formatValueToDisplay(new BigNumber(earnItem.amount)), - cryptoSymbol: tokenInfo?.symbol, - })} - - + + {t('earnFlow.poolInfoScreen.lineItemAmountDisplay', { + localCurrencySymbol, + localCurrencyAmount: formatValueToDisplay(amountInLocalCurrency), + cryptoAmount: formatValueToDisplay(new BigNumber(earnItem.amount)), + cryptoSymbol: tokenInfo?.symbol, + })} + ) } @@ -126,6 +124,7 @@ export function DepositAndEarningsCard({ label={t('earnFlow.poolInfoScreen.totalDepositAndEarnings')} labelStyle={styles.cardTitleText} testID={'DepositInfoIcon'} + numberOfLines={1} /> @@ -139,7 +138,7 @@ export function DepositAndEarningsCard({ - + {cantSeparateCompoundedInterest ? ( {t('earnFlow.poolInfoScreen.depositAndEarnings')} @@ -150,16 +149,14 @@ export function DepositAndEarningsCard({ )} - - - {t('earnFlow.poolInfoScreen.lineItemAmountDisplay', { - localCurrencySymbol, - localCurrencyAmount: formatValueToDisplay(totalDepositBalanceInLocalCurrency), - cryptoAmount: formatValueToDisplay(totalDepositBalanceInCrypto), - cryptoSymbol: depositTokenInfo?.symbol, - })} - - + + {t('earnFlow.poolInfoScreen.lineItemAmountDisplay', { + localCurrencySymbol, + localCurrencyAmount: formatValueToDisplay(totalDepositBalanceInLocalCurrency), + cryptoAmount: formatValueToDisplay(totalDepositBalanceInCrypto), + cryptoSymbol: depositTokenInfo?.symbol, + })} + {earningItems.map((item, index) => ( @@ -186,15 +183,15 @@ export function YieldCard({ return ( - + - + {yieldRateSum > 0.00005 ? t('earnFlow.poolInfoScreen.ratePercent', { rate: yieldRateSum.toFixed(2) }) : '--'} @@ -206,11 +203,9 @@ export function YieldCard({ const tokenInfo = tokensInfo.filter((token) => token.tokenId === rate.tokenId) return ( - + - - {rate.label} - + {rate.label} - + {t('earnFlow.poolInfoScreen.ratePercent', { rate: rate.percentage.toFixed(2) })} @@ -240,15 +235,15 @@ export function DailyYieldRateCard({ return ( - + - + {t('earnFlow.poolInfoScreen.ratePercent', { rate: dailyYieldRate.toFixed(4) })} @@ -274,15 +269,15 @@ export function TvlCard({ return ( - + - {tvlString} + {tvlString} ) @@ -304,23 +299,23 @@ export function AgeCard({ return ( - + - {formattedDuration(dateInterval)} + {formattedDuration(dateInterval)} ) } export const styles = StyleSheet.create({ - flexShrink: { - flexShrink: 1, + flexLabel: { + flex: 1.2, }, card: { padding: Spacing.Regular16, @@ -334,13 +329,21 @@ export const styles = StyleSheet.create({ flexDirection: 'row', justifyContent: 'space-between', }, - cardLineLabel: { - paddingRight: 20, // Prevents Icon from being cut off on long labels - }, yieldRateLabelContainer: { flexDirection: 'row', gap: Spacing.Tiny4, }, + lineLabel: { + ...typeScale.labelSemiBoldMedium, + color: Colors.black, + textAlign: 'left', + }, + lineValue: { + ...typeScale.labelSemiBoldMedium, + color: Colors.black, + textAlign: 'right', + flex: 1, + }, cardTitleText: { ...typeScale.labelSemiBoldMedium, color: Colors.black, @@ -348,6 +351,13 @@ export const styles = StyleSheet.create({ cardLabelText: { ...typeScale.bodyMedium, color: Colors.gray3, + textAlign: 'left', + }, + cardValueText: { + ...typeScale.bodyMedium, + color: Colors.black, + textAlign: 'right', + flex: 1, }, depositAndEarningCard: { backgroundColor: Colors.gray1, @@ -381,5 +391,6 @@ export const styles = StyleSheet.create({ color: Colors.black, flexWrap: 'wrap', textAlign: 'right', + flex: 1, }, }) diff --git a/src/earn/poolInfoScreen/SafetyCard.tsx b/src/earn/poolInfoScreen/SafetyCard.tsx index 58335b3dbab..6d6805f986a 100644 --- a/src/earn/poolInfoScreen/SafetyCard.tsx +++ b/src/earn/poolInfoScreen/SafetyCard.tsx @@ -53,16 +53,17 @@ export function SafetyCard({ const [expanded, setExpanded] = React.useState(false) return ( - - + + - + {BAR_HEIGHTS.map((height, index) => (