Skip to content

Commit

Permalink
Remove fiat formatting setting
Browse files Browse the repository at this point in the history
  • Loading branch information
sisou committed Aug 31, 2020
1 parent c9eff87 commit 802be74
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 71 deletions.
6 changes: 1 addition & 5 deletions src/components/FiatConvertedAmount.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<transition name="fade" mode="out-in">
<FiatAmount v-if="fiatAmount !== undefined" :amount="fiatAmount" :currency="fiatCurrency" :locale="fiatLocale"/>
<FiatAmount v-if="fiatAmount !== undefined" :amount="fiatAmount" :currency="fiatCurrency"/>
<div v-else class="fiat-amount placeholder"></div>
</transition>
</template>
Expand All @@ -9,7 +9,6 @@
import { FiatAmount } from '@nimiq/vue-components';
import { defineComponent, computed } from '@vue/composition-api';
import { useFiatStore } from '../stores/Fiat';
import { useSettingsStore } from '../stores/Settings';
import { CryptoCurrency } from '../lib/Constants';
export default defineComponent({
Expand All @@ -30,12 +29,9 @@ export default defineComponent({
: undefined,
);
const { fiatLocale } = useSettingsStore();
return {
fiatAmount,
fiatCurrency,
fiatLocale,
};
},
components: { FiatAmount } as any,
Expand Down
5 changes: 0 additions & 5 deletions src/components/PriceChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
:amount="currentPrice"
:currency="fiatCurrency"
:maxRelativeDeviation="0.001"
:locale="fiatLocale"
/>
</transition>
<transition name="fade">
Expand All @@ -42,7 +41,6 @@ import { getHistoricExchangeRates } from '@nimiq/utils';
import { FiatAmount } from '@nimiq/vue-components';
import { CryptoCurrency } from '../lib/Constants';
import { useFiatStore } from '../stores/Fiat';
import { useSettingsStore } from '../stores/Settings';
export enum TimeRange {
'24h' = '24h',
Expand Down Expand Up @@ -233,8 +231,6 @@ export default defineComponent({
}
});
const { fiatLocale } = useSettingsStore();
return {
$svg,
$path,
Expand All @@ -246,7 +242,6 @@ export default defineComponent({
history,
priceChange,
priceChangeClass,
fiatLocale,
};
},
components: {
Expand Down
6 changes: 1 addition & 5 deletions src/components/TransactionListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</div>
<div v-else class="fiat-amount flex-row">
<HistoricValueIcon/>
<FiatAmount :amount="fiatValue" :currency="fiatCurrency" :locale="fiatLocale" value-mask/>
<FiatAmount :amount="fiatValue" :currency="fiatCurrency" value-mask/>
</div>
</transition>
</div>
Expand All @@ -73,7 +73,6 @@ import {
import { AddressBook } from '@nimiq/utils';
import { useAddressStore } from '../stores/Address';
import { useFiatStore } from '../stores/Fiat';
import { useSettingsStore } from '../stores/Settings';
import { Transaction, TransactionState, useTransactionsStore } from '../stores/Transactions';
import { twoDigit } from '../lib/NumberFormatting';
import { parseData } from '../lib/DataFormatting';
Expand Down Expand Up @@ -169,8 +168,6 @@ export default defineComponent({
: undefined,
);
const { fiatLocale } = useSettingsStore();
return {
constants,
state,
Expand All @@ -183,7 +180,6 @@ export default defineComponent({
fiatValue,
isCashlink,
isIncoming,
fiatLocale,
peerAddress,
peerLabel,
};
Expand Down
16 changes: 0 additions & 16 deletions src/components/layouts/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,6 @@
{{currencyOption.toUpperCase()}}
</button>
</div>

<div class="setting">
<div class="description">
<label class="nq-h2" for="localizeFiat">{{ $t('Currency Format') }}</label>
<p class="nq-text">
{{ $t('Switch between currency specific and language specific formatting.') }}
</p>
</div>

<select id="localizeFiat" name="localizeFiat"
@input="setLocalizedFiat($event.target.value === '1')"
>
<option value="0" :selected="!localizedFiat">{{ $t('Currency specific') }}</option>
<option value="1" :selected="localizedFiat">{{ $t('Language specific') }}</option>
</select>
</div>
</section>
</div>

Expand Down
4 changes: 1 addition & 3 deletions src/components/modals/TransactionModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
<FiatAmount
:amount="fiatValue"
:currency="fiatCurrency"
:locale="fiatLocale"
value-mask/>
</template>
{{ $t('Historic value') }}
Expand Down Expand Up @@ -357,7 +356,7 @@ export default defineComponent({
const confirmations = computed(() =>
transaction.value.blockHeight ? network$.height - transaction.value.blockHeight + 1 : 0);
const { fiatLocale, amountsHidden } = useSettingsStore();
const { amountsHidden } = useSettingsStore();
return {
ENV_MAIN,
Expand All @@ -372,7 +371,6 @@ export default defineComponent({
fiatValue,
isCashlink,
isIncoming,
fiatLocale,
peerAddress,
peerLabel,
activeAddressInfo,
Expand Down
44 changes: 14 additions & 30 deletions src/i18n/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"

#: src/components/modals/TransactionModal.vue:185
#: src/components/modals/TransactionModal.vue:184
msgid "{count} Confirmation | {count} Confirmations"
msgstr ""

Expand All @@ -19,7 +19,7 @@ msgstr ""
msgid "24/7 Chat & Phone Support"
msgstr ""

#: src/components/layouts/Settings.vue:213
#: src/components/layouts/Settings.vue:197
msgid ""
"A contact with the address \"{address}\", but a different name already exists.\n"
" Do you want to replace it?"
Expand Down Expand Up @@ -97,11 +97,11 @@ msgstr ""
msgid "Bitcoin"
msgstr ""

#: src/components/modals/TransactionModal.vue:182
#: src/components/modals/TransactionModal.vue:181
msgid "Block #{height}"
msgstr ""

#: src/components/modals/TransactionModal.vue:192
#: src/components/modals/TransactionModal.vue:191
msgid "Block explorer"
msgstr ""

Expand Down Expand Up @@ -129,13 +129,13 @@ msgstr ""
msgid "By adding a transaction fee, you can influence how fast your transaction will be processed."
msgstr ""

#: src/components/layouts/Settings.vue:193
#: src/components/layouts/Settings.vue:177
msgid "Cannot import contacts, wrong file format."
msgstr ""

#: src/components/modals/TransactionModal.vue:324
#: src/components/modals/TransactionModal.vue:323
#: src/components/TransactionList.vue:61
#: src/components/TransactionListItem.vue:139
#: src/components/TransactionListItem.vue:138
msgid "Cashlink"
msgstr ""

Expand Down Expand Up @@ -241,23 +241,15 @@ msgstr ""
msgid "Credit Card accepted"
msgstr ""

#: src/components/layouts/Settings.vue:121
msgid "Currency Format"
msgstr ""

#: src/components/layouts/Settings.vue:130
msgid "Currency specific"
msgstr ""

#: src/components/modals/TransactionModal.vue:168
#: src/components/modals/TransactionModal.vue:167
msgid "Current value"
msgstr ""

#: src/components/layouts/Settings.vue:88
msgid "Developer"
msgstr ""

#: src/components/layouts/Settings.vue:140
#: src/components/layouts/Settings.vue:124
#: src/components/modals/DisclaimerModal.vue:5
msgid "Disclaimer"
msgstr ""
Expand Down Expand Up @@ -338,7 +330,7 @@ msgstr ""
msgid "Fiat value unavailable"
msgstr ""

#: src/components/layouts/Settings.vue:199
#: src/components/layouts/Settings.vue:183
msgid "File contains no contacts."
msgstr ""

Expand Down Expand Up @@ -393,7 +385,7 @@ msgstr ""
msgid "Handling multiple addresses is now convenient and easy – with one password and shared login information."
msgstr ""

#: src/components/modals/TransactionModal.vue:163
#: src/components/modals/TransactionModal.vue:162
msgid "Historic value"
msgstr ""

Expand Down Expand Up @@ -445,10 +437,6 @@ msgstr ""
msgid "Language"
msgstr ""

#: src/components/layouts/Settings.vue:131
msgid "Language specific"
msgstr ""

#: src/components/modals/NetworkInfoModal.vue:19
#: src/components/modals/TradeModal.vue:107
msgid "Learn more"
Expand Down Expand Up @@ -532,7 +520,7 @@ msgstr ""
msgid "not sent"
msgstr ""

#: src/components/layouts/Settings.vue:222
#: src/components/layouts/Settings.vue:206
msgid "OK! Contacts imported successfully."
msgstr ""

Expand Down Expand Up @@ -758,10 +746,6 @@ msgstr ""
msgid "Store, send and receive NIM."
msgstr ""

#: src/components/layouts/Settings.vue:123
msgid "Switch between currency specific and language specific formatting."
msgstr ""

#: src/components/NetworkStats.vue:45
msgid "syncing"
msgstr ""
Expand Down Expand Up @@ -829,8 +813,8 @@ msgstr ""
msgid "Tweet your map!"
msgstr ""

#: src/components/modals/TransactionModal.vue:325
#: src/components/TransactionListItem.vue:140
#: src/components/modals/TransactionModal.vue:324
#: src/components/TransactionListItem.vue:139
msgid "Unclaimed Cashlink"
msgstr ""

Expand Down
7 changes: 0 additions & 7 deletions src/stores/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export enum ColorMode {
export type SettingsState = {
decimals: 0 | 2 | 5,
language: string, // locale
localizedFiat: boolean, // Whether to apply the set language to formatted fiat displays
colorMode: ColorMode,
amountsHidden: boolean,
};
Expand All @@ -20,15 +19,12 @@ export const useSettingsStore = createStore({
state: (): SettingsState => ({
decimals: 0,
language: detectLanguage(),
localizedFiat: false,
colorMode: ColorMode.AUTOMATIC,
amountsHidden: false,
}),
getters: {
decimals: (state): Readonly<number> => state.decimals,
language: (state): Readonly<string> => state.language,
localizedFiat: (state): Readonly<boolean> => state.localizedFiat,
fiatLocale: (state): Readonly<string> => state.localizedFiat ? state.language : '',
colorMode: (state): Readonly<ColorMode> => state.colorMode,
amountsHidden: (state): Readonly<boolean> => state.amountsHidden,
},
Expand All @@ -48,8 +44,5 @@ export const useSettingsStore = createStore({
toggleAmountsHidden() {
this.state.amountsHidden = !this.state.amountsHidden;
},
setLocalizedFiat(localizedFiat: boolean) {
this.state.localizedFiat = localizedFiat;
},
},
});

0 comments on commit 802be74

Please sign in to comment.