From 5c720579b50ab608aeb060e4bf44dbb97b7891de Mon Sep 17 00:00:00 2001 From: Danil Lysak Date: Wed, 19 Jul 2023 20:32:22 +0300 Subject: [PATCH 1/4] feat: Add currency code in record list --- src/api/currencies.ts | 4 ++- src/components/common/currency-code.vue | 32 +++++++++++++++++++ .../transactions-list/mono-transaction.vue | 5 +++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/components/common/currency-code.vue diff --git a/src/api/currencies.ts b/src/api/currencies.ts index 38c9b7d1..9516d3e3 100644 --- a/src/api/currencies.ts +++ b/src/api/currencies.ts @@ -18,7 +18,9 @@ export const deleteCustomRate = ( baseCode: string; quoteCode: string; }[], -) => api.delete('/user/currency/rates', { pairs }); +) => { + api.delete('/user/currency/rates', { pairs }); +} export const loadUserCurrenciesExchangeRates = async () => { const result = await api.get('/user/currencies/rates'); diff --git a/src/components/common/currency-code.vue b/src/components/common/currency-code.vue new file mode 100644 index 00000000..fc8d97ab --- /dev/null +++ b/src/components/common/currency-code.vue @@ -0,0 +1,32 @@ + + + diff --git a/src/components/transactions-list/mono-transaction.vue b/src/components/transactions-list/mono-transaction.vue index 1ccd0cf1..a63ac74b 100644 --- a/src/components/transactions-list/mono-transaction.vue +++ b/src/components/transactions-list/mono-transaction.vue @@ -15,6 +15,7 @@
{{ formatAmount(tx.amount) }} +
@@ -31,6 +32,7 @@ import { MonobankTrasnactionModel } from 'shared-types'; import { useCategoriesStore } from '@/stores'; import { MODAL_TYPES, useModalCenter } from '@/components/modal-center/index'; import { formatAmount } from '@/js/helpers'; +import currencyCode from '@/components/common/currency-code.vue' export default defineComponent({ props: { @@ -39,6 +41,9 @@ export default defineComponent({ required: true, }, }, + components: { + currencyCode + }, setup(props) { const { getCategoryTypeById } = useCategoriesStore(); const { addModal } = useModalCenter(); From 8031ab9762a03d211a7769df814e579db08d2279 Mon Sep 17 00:00:00 2001 From: Danil Lysak Date: Wed, 19 Jul 2023 20:39:17 +0300 Subject: [PATCH 2/4] fix: Fix some linter problem --- src/api/currencies.ts | 2 +- src/components/common/currency-code.vue | 6 +++--- src/components/transactions-list/mono-transaction.vue | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/api/currencies.ts b/src/api/currencies.ts index 9516d3e3..77233e4b 100644 --- a/src/api/currencies.ts +++ b/src/api/currencies.ts @@ -20,7 +20,7 @@ export const deleteCustomRate = ( }[], ) => { api.delete('/user/currency/rates', { pairs }); -} +}; export const loadUserCurrenciesExchangeRates = async () => { const result = await api.get('/user/currencies/rates'); diff --git a/src/components/common/currency-code.vue b/src/components/common/currency-code.vue index fc8d97ab..b5168894 100644 --- a/src/components/common/currency-code.vue +++ b/src/components/common/currency-code.vue @@ -3,7 +3,7 @@ diff --git a/src/components/fields/input-field.vue b/src/components/fields/input-field.vue index 0197ffb6..a6984a4e 100644 --- a/src/components/fields/input-field.vue +++ b/src/components/fields/input-field.vue @@ -13,20 +13,30 @@ - +
+
+ +
+ + + +
+ {{ currencyCode }} +
+