Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/component/label.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const balanceStyles = StyleSheet.create({
numeral: {
fontFamily: 'WorkSans ExtraLight',
fontSize: font.sizeXXXL,
lineHeight: font.lineHeightXXXL,
lineHeight: null,
},
unit: {
fontFamily: 'WorkSans Regular',
Expand All @@ -35,7 +35,13 @@ BalanceLabel.propTypes = {
};

export const BalanceLabelNumeral = ({ children, style }) => (
<Text style={[balanceStyles.numeral, style]}>{children}</Text>
<Text
style={[balanceStyles.numeral, style]}
adjustsFontSizeToFit={true}
numberOfLines={1}
>
{children}
</Text>
);

BalanceLabelNumeral.propTypes = {
Expand Down
8 changes: 4 additions & 4 deletions src/component/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const CopyOnboardText = ({ children = '', style }) => (
);

CopyOnboardText.propTypes = {
children: PropTypes.string.isRequired,
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
style: RNText.propTypes.style,
};

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

H1Text.propTypes = {
children: PropTypes.string.isRequired,
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
style: RNText.propTypes.style,
};

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

H3Text.propTypes = {
children: PropTypes.string.isRequired,
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
style: RNText.propTypes.style,
};

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

H4Text.propTypes = {
children: PropTypes.string.isRequired,
children: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
style: RNText.propTypes.style,
};

Expand Down
2 changes: 1 addition & 1 deletion src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class Store {
settings: {
unit: DEFAULT_UNIT,
fiat: DEFAULT_FIAT,
displayFiat: true,
displayFiat: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So bold

exchangeRate: {},
restoring: false,
autopilot: true,
Expand Down
8 changes: 2 additions & 6 deletions src/view/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ import { H4Text } from '../component/text';
import Icon from '../component/icon';
import QrIcon from '../asset/icon/qr';
import LightningBoltPurpleIcon from '../asset/icon/lightning-bolt-purple';
import {
BalanceLabel,
BalanceLabelNumeral,
BalanceLabelUnit,
} from '../component/label';
import { BalanceLabel, BalanceLabelNumeral } from '../component/label';
import { Button, GlasButton, DownButton } from '../component/button';

//
Expand Down Expand Up @@ -113,9 +109,9 @@ const BalanceDisplay = ({
}) => (
<View style={balanceStyles.wrapper}>
<Button onPress={toggleDisplayFiat}>
<H4Text>Total {unitLabel}</H4Text>
<BalanceLabel>
<BalanceLabelNumeral>{totalBalanceLabel}</BalanceLabelNumeral>
<BalanceLabelUnit>{unitLabel}</BalanceLabelUnit>
</BalanceLabel>
</Button>
<Button onPress={goChannels} style={balanceStyles.percentBtn}>
Expand Down
1 change: 1 addition & 0 deletions test/unit/computed/wallet.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('Computed Wallet Unit Tests', () => {

describe('ComputedWallet()', () => {
it('should work with initial store', () => {
store.settings.displayFiat = true;
store.channelBalancePendingSatoshis = 0;
store.channelBalanceOpenSatoshis = 0;
store.channelBalanceInactiveSatoshis = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/unit/store.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Store Unit Tests', () => {
it('should set computed vales', () => {
expect(store.unitFiatLabel, 'to be', undefined);
store.init();
expect(store.unitFiatLabel, 'to equal', '$');
expect(store.unitFiatLabel, 'to equal', 'SAT');
});
});
});