Skip to content

Commit 401da38

Browse files
committed
fix(ui): fix spacing & font for Money components
1 parent b6525d5 commit 401da38

File tree

15 files changed

+32
-34
lines changed

15 files changed

+32
-34
lines changed

src/components/AmountToggle.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { EBalanceUnit } from '../store/types/wallet';
1313
const AmountToggle = ({
1414
sats,
1515
unit,
16+
secondaryFont = 'caption13Up',
1617
space = 0, // space between the rows
1718
reverse = false,
1819
disable = false,
@@ -23,6 +24,7 @@ const AmountToggle = ({
2324
testID,
2425
}: {
2526
sats: number;
27+
secondaryFont?: 'text01m' | 'caption13Up';
2628
unit?: EBalanceUnit;
2729
reverse?: boolean;
2830
space?: number;
@@ -51,15 +53,15 @@ const AmountToggle = ({
5153
<Money
5254
key="secondary"
5355
sats={sats}
54-
size="text01m"
56+
size={secondaryFont}
5557
color="gray1"
5658
decimalLength={decimalLength}
5759
{...{ ...(primaryUnit === EBalanceUnit.fiat ? btcProps : fiatProps) }}
5860
/>,
5961
];
6062

6163
return reverse ? arr.reverse() : arr;
62-
}, [primaryUnit, sats, reverse, space, decimalLength]);
64+
}, [primaryUnit, sats, reverse, space, decimalLength, secondaryFont]);
6365

6466
LayoutAnimation.easeInEaseOut();
6567

src/components/BalanceHeader.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,12 @@ const BalanceHeader = (): ReactElement => {
7676
pending: (
7777
<Money
7878
color="gray1"
79-
size="caption13M"
79+
size="caption13Up"
8080
sats={claimableBalance}
8181
unit={balanceUnit}
8282
enableHide={true}
8383
symbol={false}
84+
decimalLength="long"
8485
/>
8586
),
8687
}}

src/components/ImageText.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { memo, ReactElement } from 'react';
22
import { View, TouchableOpacity, StyleSheet } from 'react-native';
3-
import { Text01M, Caption13M } from '../styles/text';
3+
import { Text01M, Text02M } from '../styles/text';
44
import { PenIcon } from '../styles/icons';
55
import Money from '../components/Money';
66

@@ -28,7 +28,7 @@ const ImageText = ({
2828
{icon}
2929
<View style={styles.titleContainer}>
3030
<Text01M>{title}</Text01M>
31-
<Caption13M color="gray1">{description}</Caption13M>
31+
<Text02M color="gray1">{description}</Text02M>
3232
</View>
3333
</View>
3434

@@ -46,7 +46,7 @@ const ImageText = ({
4646
<Money
4747
style={styles.value}
4848
sats={value}
49-
size="caption13M"
49+
size="text02m"
5050
color="gray1"
5151
symbol={true}
5252
showFiat={true}

src/components/Money.tsx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ import { useSelector } from 'react-redux';
44

55
import {
66
Caption13M,
7+
Caption13Up,
78
Display,
8-
Headline,
99
Text01M,
10-
Text01S,
1110
Text02M,
12-
Text02S,
1311
Title,
1412
} from '../styles/text';
1513
import { BIcon, LightningIcon } from '../styles/icons';
@@ -36,13 +34,11 @@ interface IMoney {
3634
testID?: string;
3735
size?:
3836
| 'display'
39-
| 'text01s'
4037
| 'text01m'
41-
| 'text02s'
4238
| 'text02m'
4339
| 'caption13M'
44-
| 'title'
45-
| 'headline';
40+
| 'caption13Up'
41+
| 'title';
4642
}
4743

4844
const Money = (props: IMoney): ReactElement => {
@@ -68,20 +64,15 @@ const Money = (props: IMoney): ReactElement => {
6864

6965
const [Text, lineHeight, iconHeight, iconWidth] = useMemo(() => {
7066
switch (size) {
71-
case 'headline':
72-
// Override lineHeight for Display font
73-
return [Headline, '41px', 40, 20];
7467
case 'title':
7568
return [Title, undefined, 26, 12];
76-
case 'text01s':
77-
return [Text01S, undefined, 21, 10];
7869
case 'text01m':
7970
return [Text01M, undefined, 21, 10];
80-
case 'text02s':
81-
return [Text02S, undefined, 18, 9];
8271
case 'text02m':
8372
return [Text02M, undefined, 18, 9];
8473
case 'caption13M':
74+
return [Caption13Up, undefined, 16, 8];
75+
case 'caption13Up':
8576
return [Caption13M, undefined, 16, 8];
8677
default:
8778
// Override lineHeight for Display font

src/components/NumberPadTextField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const NumberPadTextField = ({
9696
<Money
9797
style={styles.secondary}
9898
sats={satoshis}
99-
size="text01m"
99+
size="caption13Up"
100100
color="gray1"
101101
{...{ ...(unit === EBalanceUnit.fiat ? btcProps : fiatProps) }}
102102
/>

src/screens/Activity/ActivityDetail.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ const OnchainActivityDetail = ({
320320
<Money
321321
sats={value}
322322
unit={EBalanceUnit.fiat}
323-
size="caption13M"
323+
size="caption13Up"
324324
color="gray1"
325325
/>
326326
<View style={styles.title}>
@@ -632,7 +632,7 @@ const LightningActivityDetail = ({
632632
<Money
633633
sats={value}
634634
unit={EBalanceUnit.fiat}
635-
size="caption13M"
635+
size="caption13Up"
636636
color="gray1"
637637
/>
638638
<View style={styles.title}>

src/screens/Lightning/CustomConfirm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ const CustomConfirm = ({
139139
<Caption13Up color="purple" style={styles.space}>
140140
{t('spending_label')}
141141
</Caption13Up>
142-
<AmountToggle sats={spendingAmount} />
142+
<AmountToggle sats={spendingAmount} secondaryFont="text01m" />
143143
</View>
144144

145145
<View style={styles.block}>
146146
<Caption13Up color="purple" style={styles.space}>
147147
{t('receiving_label')}
148148
</Caption13Up>
149-
<AmountToggle sats={receivingAmount} />
149+
<AmountToggle sats={receivingAmount} secondaryFont="text01m" />
150150
</View>
151151
</AnimatedView>
152152
)}

src/screens/Lightning/QuickConfirm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const QuickConfirm = ({
117117
<Caption13Up style={styles.amountCaption} color="purple">
118118
{t('spending_label')}
119119
</Caption13Up>
120-
<AmountToggle sats={spendingAmount} />
120+
<AmountToggle sats={spendingAmount} secondaryFont="text01m" />
121121
</View>
122122

123123
<SwipeToConfirm

src/screens/Transfer/Confirm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const Confirm = ({
141141
<Caption13Up style={styles.amountCaption} color="purple">
142142
{t('spending_label')}
143143
</Caption13Up>
144-
<AmountToggle sats={spendingAmount} />
144+
<AmountToggle sats={spendingAmount} secondaryFont="text01m" />
145145
</View>
146146

147147
<SwipeToConfirm

src/screens/Wallets/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const EnabledSlashtagsProfileButton = (): ReactElement => {
3939
{profile?.name ? (
4040
<Title>{truncate(profile?.name, 20)}</Title>
4141
) : (
42-
<Title>{t('your_name')}</Title>
42+
<Title>{t('your_name_capital')}</Title>
4343
)}
4444
</TouchableOpacity>
4545
);

0 commit comments

Comments
 (0)