From 1583d8b601457968018c71aa4c3ce66c4b6b5384 Mon Sep 17 00:00:00 2001 From: Simon Reinisch Date: Mon, 20 May 2024 13:59:36 +0200 Subject: [PATCH] feat: add more currencies closes #39 --- src/store/state/migrator.ts | 2 +- src/store/state/types.ts | 45 +++++++++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/store/state/migrator.ts b/src/store/state/migrator.ts index 1f9c6492..f1bbe211 100644 --- a/src/store/state/migrator.ts +++ b/src/store/state/migrator.ts @@ -26,7 +26,7 @@ export const migrateApplicationState = createMigrator({ to: 3, migrate: (from) => ({ locale: initialLocale, - currency: 'gbp', + currency: 'GBP', years: from.years }) }) diff --git a/src/store/state/types.ts b/src/store/state/types.ts index f18dd6f2..2d50913e 100644 --- a/src/store/state/types.ts +++ b/src/store/state/types.ts @@ -3,9 +3,50 @@ import { AvailableLocale } from '@i18n/index'; export type BudgetValues = number[]; -export const availableCurrencies = ['gbp', 'eur', 'usd']; +export const availableCurrencies = [ + 'USD', + 'EUR', + 'JPY', + 'GBP', + 'AUD', + 'CAD', + 'CHF', + 'CNY', + 'SEK', + 'NZD', + 'MXN', + 'SGD', + 'HKD', + 'NOK', + 'KRW', + 'TRY', + 'INR', + 'RUB', + 'BRL', + 'ZAR' +]; -export type AvailableCurrency = 'gbp' | 'eur' | 'usd'; +export type AvailableCurrency = + | 'USD' + | 'EUR' + | 'JPY' + | 'GBP' + | 'AUD' + | 'CAD' + | 'CHF' + | 'CNY' + | 'SEK' + | 'NZD' + | 'MXN' + | 'SGD' + | 'HKD' + | 'NOK' + | 'KRW' + | 'TRY' + | 'INR' + | 'RUB' + | 'BRL' + | 'ZAR'; export interface Budget { id: string;