From 4bbb1854ff8a7630720c1c1fae71845443435ddc Mon Sep 17 00:00:00 2001
From: NextFire
Date: Mon, 25 Mar 2024 18:30:17 -0400
Subject: [PATCH] fix hydration
---
.../expenses/{Card.vue => Card.client.vue} | 14 +-
.../expenses/{View.vue => View.client.vue} | 0
components/new-expense/Infos.vue | 14 +-
components/new-expense/Participants.vue | 2 +-
nuxt.config.ts | 2 +-
package-lock.json | 141 ++++++++++++++++++
package.json | 2 +
pages/[id].vue | 10 +-
utils/dinero.ts | 12 +-
9 files changed, 171 insertions(+), 26 deletions(-)
rename components/expenses/{Card.vue => Card.client.vue} (93%)
rename components/expenses/{View.vue => View.client.vue} (100%)
diff --git a/components/expenses/Card.vue b/components/expenses/Card.client.vue
similarity index 93%
rename from components/expenses/Card.vue
rename to components/expenses/Card.client.vue
index 6cd35f1..4435022 100644
--- a/components/expenses/Card.vue
+++ b/components/expenses/Card.client.vue
@@ -80,12 +80,14 @@ const expenseFormStore = useExpenseFormStore();
Paid by {{ author?.name }}
- {{
- new Date(expense.date).toLocaleDateString(undefined, {
- timeZone: "UTC",
- dateStyle: "long",
- })
- }}
+
+ {{
+ new Date(expense.date).toLocaleDateString(undefined, {
+ timeZone: "UTC",
+ dateStyle: "long",
+ })
+ }}
+
diff --git a/components/expenses/View.vue b/components/expenses/View.client.vue
similarity index 100%
rename from components/expenses/View.vue
rename to components/expenses/View.client.vue
diff --git a/components/new-expense/Infos.vue b/components/new-expense/Infos.vue
index 60bbdef..05f541c 100644
--- a/components/new-expense/Infos.vue
+++ b/components/new-expense/Infos.vue
@@ -1,5 +1,5 @@
diff --git a/utils/dinero.ts b/utils/dinero.ts
index 03fc73e..d8b56b9 100644
--- a/utils/dinero.ts
+++ b/utils/dinero.ts
@@ -25,12 +25,6 @@ export function toString(amount: Dinero): string {
);
}
-export const currencyRecord: Record<
- Currency["code"],
- Currency
-> = {};
-for (const currency of Object.values(currencies)) {
- if (currency.code) {
- currencyRecord[currency.code] = currency;
- }
-}
+export const currencyRecord = Object.fromEntries(
+ Object.values(currencies).map((currency) => [currency.code, currency])
+);