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

MXN amounts; depends on MXN ticker to be included on API response #1190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions src/action/index-mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ store.channelBalanceSatoshis = 598760;
store.settings.exchangeRate.usd = 0.00016341;
store.settings.exchangeRate.eur = 0.0001896;
store.settings.exchangeRate.gbp = 0.00021405;
store.settings.exchangeRate.mxn = 0.00000566;
store.invoice.amount = '0.45678';
store.invoice.note = 'For the love of bitcoin';
store.invoice.encoded =
Expand Down
3 changes: 3 additions & 0 deletions src/computed/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ const ComputedSetting = store => {
get gbpFiatLabel() {
return FIATS['gbp'].displayLong;
},
get mxnFiatLabel() {
return FIATS['mxn'].displayLong;
},
});
};

Expand Down
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports.FIATS = {
usd: { display: '$', displayLong: 'US Dollar' },
eur: { display: '€', displayLong: 'Euro' },
gbp: { display: '£', displayLong: 'British Pound' },
mxn: { display: '$', displayLong: 'Mexican Peso' },
};
module.exports.DEFAULT_UNIT = 'sat';
module.exports.DEFAULT_FIAT = 'usd';
6 changes: 6 additions & 0 deletions src/view/setting-fiat.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ const SettingFiatView = ({ store, nav, setting }) => {
>
<RadioButton selected={'gbp' === store.settings.fiat} />
</SettingItem>
<SettingItem
name={store.mxnFiatLabel}
onSelect={() => setting.setFiatCurrency({ fiat: 'mxn' })}
>
<RadioButton selected={'mxn' === store.settings.fiat} />
</SettingItem>
</SettingList>
</SettingContent>
</Background>
Expand Down
1 change: 1 addition & 0 deletions stories/screen-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ store.channelBalanceSatoshis = 598760;
store.settings.exchangeRate.usd = 0.00016341;
store.settings.exchangeRate.eur = 0.0001896;
store.settings.exchangeRate.gbp = 0.00021405;
store.settings.exchangeRate.mxn = 0.00000566;
store.invoice.amount = '0.45678';
store.invoice.note = 'For the love of bitcoin';
store.invoice.encoded =
Expand Down
5 changes: 5 additions & 0 deletions test/unit/action/wallet.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,11 @@ describe('Action Wallet Unit Tests', () => {
"date": "2019-04-04T03:30:05.000Z",
"rate": 498467,
"ticker": "USD"
},
{
"date": "2019-04-04T03:30:05.000Z",
"rate": 9401718,
"ticker": "MXN"
}
]
}`;
Expand Down
1 change: 1 addition & 0 deletions test/unit/computed/setting.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('Computed Settings Unit Tests', () => {
expect(store.usdFiatLabel, 'to be ok');
expect(store.eurFiatLabel, 'to be ok');
expect(store.gbpFiatLabel, 'to be ok');
expect(store.mxnFiatLabel, 'to be ok');
});

it('should display satoshis denominated in BTC', () => {
Expand Down