Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 2b520f5

Browse files
authored
Merge pull request #1295 from lightninglabs/dev/fix-home-balance-font-size
Dev/fix home balance font size
2 parents c8cd522 + 8305fff commit 2b520f5

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

src/component/label.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const balanceStyles = StyleSheet.create({
1515
numeral: {
1616
fontFamily: 'WorkSans ExtraLight',
1717
fontSize: font.sizeXXXL,
18-
lineHeight: font.lineHeightXXXL,
18+
lineHeight: null,
1919
},
2020
unit: {
2121
fontFamily: 'WorkSans Regular',
@@ -35,7 +35,13 @@ BalanceLabel.propTypes = {
3535
};
3636

3737
export const BalanceLabelNumeral = ({ children, style }) => (
38-
<Text style={[balanceStyles.numeral, style]}>{children}</Text>
38+
<Text
39+
style={[balanceStyles.numeral, style]}
40+
adjustsFontSizeToFit={true}
41+
numberOfLines={1}
42+
>
43+
{children}
44+
</Text>
3945
);
4046

4147
BalanceLabelNumeral.propTypes = {

src/component/text.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const CopyOnboardText = ({ children = '', style }) => (
6565
);
6666

6767
CopyOnboardText.propTypes = {
68-
children: PropTypes.string.isRequired,
68+
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
6969
style: RNText.propTypes.style,
7070
};
7171

@@ -86,7 +86,7 @@ export const H1Text = ({ children = '', style }) => (
8686
);
8787

8888
H1Text.propTypes = {
89-
children: PropTypes.string.isRequired,
89+
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
9090
style: RNText.propTypes.style,
9191
};
9292

@@ -107,7 +107,7 @@ export const H3Text = ({ children = '', style }) => (
107107
);
108108

109109
H3Text.propTypes = {
110-
children: PropTypes.string.isRequired,
110+
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
111111
style: RNText.propTypes.style,
112112
};
113113

@@ -128,7 +128,7 @@ export const H4Text = ({ children, style }) => (
128128
);
129129

130130
H4Text.propTypes = {
131-
children: PropTypes.string.isRequired,
131+
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
132132
style: RNText.propTypes.style,
133133
};
134134

src/store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class Store {
9494
settings: {
9595
unit: DEFAULT_UNIT,
9696
fiat: DEFAULT_FIAT,
97-
displayFiat: true,
97+
displayFiat: false,
9898
exchangeRate: {},
9999
restoring: false,
100100
autopilot: true,

src/view/home.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ import { H4Text } from '../component/text';
1111
import Icon from '../component/icon';
1212
import QrIcon from '../asset/icon/qr';
1313
import LightningBoltPurpleIcon from '../asset/icon/lightning-bolt-purple';
14-
import {
15-
BalanceLabel,
16-
BalanceLabelNumeral,
17-
BalanceLabelUnit,
18-
} from '../component/label';
14+
import { BalanceLabel, BalanceLabelNumeral } from '../component/label';
1915
import { Button, GlasButton, DownButton } from '../component/button';
2016

2117
//
@@ -113,9 +109,9 @@ const BalanceDisplay = ({
113109
}) => (
114110
<View style={balanceStyles.wrapper}>
115111
<Button onPress={toggleDisplayFiat}>
112+
<H4Text>Total {unitLabel}</H4Text>
116113
<BalanceLabel>
117114
<BalanceLabelNumeral>{totalBalanceLabel}</BalanceLabelNumeral>
118-
<BalanceLabelUnit>{unitLabel}</BalanceLabelUnit>
119115
</BalanceLabel>
120116
</Button>
121117
<Button onPress={goChannels} style={balanceStyles.percentBtn}>

test/unit/computed/wallet.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ describe('Computed Wallet Unit Tests', () => {
1010

1111
describe('ComputedWallet()', () => {
1212
it('should work with initial store', () => {
13+
store.settings.displayFiat = true;
1314
store.channelBalancePendingSatoshis = 0;
1415
store.channelBalanceOpenSatoshis = 0;
1516
store.channelBalanceInactiveSatoshis = 0;

test/unit/store.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('Store Unit Tests', () => {
1111
it('should set computed vales', () => {
1212
expect(store.unitFiatLabel, 'to be', undefined);
1313
store.init();
14-
expect(store.unitFiatLabel, 'to equal', '$');
14+
expect(store.unitFiatLabel, 'to equal', 'SAT');
1515
});
1616
});
1717
});

0 commit comments

Comments
 (0)