Skip to content

Commit

Permalink
feat: Show account category on details page
Browse files Browse the repository at this point in the history
  • Loading branch information
letehaha committed Jan 28, 2024
1 parent 0ae6f8a commit 0f51d7b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/common/const/account-categories-verbose.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { ACCOUNT_CATEGORIES } from "shared-types";

export const ACCOUNT_CATEGORIES_VERBOSE = Object.freeze({
[ACCOUNT_CATEGORIES.general]: "General",
[ACCOUNT_CATEGORIES.cash]: "Cash",
[ACCOUNT_CATEGORIES.currentAccount]: "Current account",
[ACCOUNT_CATEGORIES.creditCard]: "Credit card",
[ACCOUNT_CATEGORIES.saving]: "Saving account",
[ACCOUNT_CATEGORIES.bonus]: "Bonus",
[ACCOUNT_CATEGORIES.insurance]: "Insurance",
[ACCOUNT_CATEGORIES.investment]: "Investment",
[ACCOUNT_CATEGORIES.loan]: "Loan",
[ACCOUNT_CATEGORIES.mortgage]: "Mortgage",
[ACCOUNT_CATEGORIES.overdraft]: "Overdraft",
[ACCOUNT_CATEGORIES.crypto]: "Crypto",
});
2 changes: 2 additions & 0 deletions src/common/const/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ export const OUT_OF_WALLET_ACCOUNT_MOCK = {
name: OUT_OF_WALLET_ACCOUNT_NAME,
id: null,
} as OutOfWalletAccountModel;

export * from "./account-categories-verbose";
10 changes: 10 additions & 0 deletions src/pages/account/components/account-details-tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as Collapsible from "@/components/lib/ui/collapsible";
import { Separator } from "@/components/lib/ui/separator";
import { useCurrenciesStore } from "@/stores";
import { toLocalNumber } from "@/js/helpers";
import { ACCOUNT_CATEGORIES_VERBOSE } from "@/common/const";
defineProps<{
account: AccountModel;
Expand Down Expand Up @@ -44,6 +45,15 @@ const isOpen = ref(false);
</div>
<Separator />

<div class="flex items-center justify-between gap-2">
<span> Account Category: </span>

<span class="capitalize">
{{ ACCOUNT_CATEGORIES_VERBOSE[account.accountCategory] }}
</span>
</div>
<Separator />

<Collapsible.Collapsible v-model:open="isOpen">
<Collapsible.CollapsibleTrigger class="w-full">
<div class="flex items-center justify-between gap-2">
Expand Down

0 comments on commit 0f51d7b

Please sign in to comment.