diff --git a/app/lib/actions/billActions.ts b/app/lib/actions/billActions.ts index 97820ff..0db48ab 100644 --- a/app/lib/actions/billActions.ts +++ b/app/lib/actions/billActions.ts @@ -26,7 +26,7 @@ export type State = { */ const FormSchema = (t:IntlTemplateFn) => z.object({ _id: z.string(), - billName: z.coerce.string().min(1, t("validation.bill-name-required")), + billName: z.coerce.string().min(1, t("bill-name-required")), billNotes: z.string(), payedAmount: z.string().nullable().transform((val, ctx) => { @@ -39,7 +39,7 @@ const FormSchema = (t:IntlTemplateFn) => z.object({ if (isNaN(parsed)) { ctx.addIssue({ code: z.ZodIssueCode.custom, - message: t("validation.not-a-number"), + message: t("not-a-number"), }); // This is a special symbol you can use to @@ -52,7 +52,7 @@ const FormSchema = (t:IntlTemplateFn) => z.object({ if (parsed < 0) { ctx.addIssue({ code: z.ZodIssueCode.custom, - message: t("validation.negative-number") + message: t("negative-number") }); // This is a special symbol you can use to @@ -115,7 +115,7 @@ export const updateOrAddBill = withUser(async (user:AuthenticatedUser, locationI const { id: userId } = user; - const t = await getTranslations("bill-edit-form"); + const t = await getTranslations("bill-edit-form.validation"); // FormSchema const validatedFields = FormSchema(t) @@ -131,7 +131,7 @@ export const updateOrAddBill = withUser(async (user:AuthenticatedUser, locationI console.log("updateBill.validation-error"); return({ errors: validatedFields.error.flatten().fieldErrors, - message: t("validation.form-error-message"), + message: t("form-error-message"), }); } diff --git a/app/lib/actions/locationActions.ts b/app/lib/actions/locationActions.ts index b662c6a..635acfb 100644 --- a/app/lib/actions/locationActions.ts +++ b/app/lib/actions/locationActions.ts @@ -25,7 +25,7 @@ export type State = { */ const FormSchema = (t:IntlTemplateFn) => z.object({ _id: z.string(), - locationName: z.coerce.string().min(1, t("validation.location-name-required")), + locationName: z.coerce.string().min(1, t("location-name-required")), locationNotes: z.string(), }) // dont include the _id field in the response @@ -42,7 +42,7 @@ export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locat noStore(); - const t = await getTranslations("location-edit-form"); + const t = await getTranslations("location-edit-form.validation"); const validatedFields = FormSchema(t).safeParse({ locationName: formData.get('locationName'), diff --git a/app/ui/AddLocationButton.tsx b/app/ui/AddLocationButton.tsx index a14f4f8..2f68524 100644 --- a/app/ui/AddLocationButton.tsx +++ b/app/ui/AddLocationButton.tsx @@ -11,11 +11,11 @@ export interface AddLocationButtonProps { export const AddLocationButton:React.FC = ({yearMonth}) => { - const t = useTranslations("home-page"); + const t = useTranslations("home-page.add-location-button"); return(
- + diff --git a/app/ui/AddMonthButton.tsx b/app/ui/AddMonthButton.tsx index 9e51c9f..8ba1484 100644 --- a/app/ui/AddMonthButton.tsx +++ b/app/ui/AddMonthButton.tsx @@ -1,3 +1,5 @@ +"use client"; + import { PlusCircleIcon, CalendarDaysIcon } from "@heroicons/react/24/outline"; import React from "react"; import { formatYearMonth } from "../lib/format"; @@ -11,12 +13,12 @@ export interface AddMonthButtonProps { export const AddMonthButton:React.FC = ({ yearMonth }) => { - const t = useTranslations("home-page"); + const t = useTranslations("home-page.add-month-button"); const locale = useLocale(); return(
- + diff --git a/app/ui/BillDeleteForm.tsx b/app/ui/BillDeleteForm.tsx index 3743c3b..b5d79b0 100644 --- a/app/ui/BillDeleteForm.tsx +++ b/app/ui/BillDeleteForm.tsx @@ -29,7 +29,7 @@ export const BillDeleteForm:FC = ({ bill, location }) => { t.rich("text", { bill_name:bill.name, location_name:location.name, - strong: (chunks:ReactNode) => ${chunks}, + strong: (chunks:ReactNode) => {chunks}, }) }

diff --git a/app/ui/LocationCard.tsx b/app/ui/LocationCard.tsx index 1510a30..ce257ca 100644 --- a/app/ui/LocationCard.tsx +++ b/app/ui/LocationCard.tsx @@ -1,7 +1,7 @@ -'client only'; +'use client'; import { Cog8ToothIcon, PlusCircleIcon } from "@heroicons/react/24/outline"; -import { FC, ReactNode } from "react"; +import { FC } from "react"; import { BillBadge } from "./BillBadge"; import { BillingLocation } from "../lib/db-types"; import { formatYearMonth } from "../lib/format"; @@ -38,7 +38,7 @@ export const LocationCard:FC = ({location: { _id, name, yearM { monthlyExpense > 0 ?

- { t("payed-total") } ${monthlyExpense} + { t("payed-total") } ${formatCurrency(monthlyExpense)}

: null } diff --git a/app/ui/LocationDeleteForm.tsx b/app/ui/LocationDeleteForm.tsx index d3b8c6e..0524aa9 100644 --- a/app/ui/LocationDeleteForm.tsx +++ b/app/ui/LocationDeleteForm.tsx @@ -32,7 +32,7 @@ export const LocationDeleteForm:FC = ({ location }) => { t.rich("text", { name:location.name, - strong: (chunks:ReactNode) => `${chunks}`, + strong: (chunks:ReactNode) => {chunks}, }) }

diff --git a/app/ui/SelectLanguage.tsx b/app/ui/SelectLanguage.tsx index 478eeba..28b2e3a 100644 --- a/app/ui/SelectLanguage.tsx +++ b/app/ui/SelectLanguage.tsx @@ -12,5 +12,5 @@ export const SelectLanguage: React.FC = () => { const secondLocale = locales.find((l) => l !== currentLocale) as string; const secondLocalePathname = defaultLocale === currentLocale ? `/${secondLocale}${currentPathname}` : currentPathname.replace(`/${currentLocale}`, `/${secondLocale}`); - return ({localeNames[secondLocale]}); + return ({localeNames[secondLocale]}); } \ No newline at end of file diff --git a/docker-compose-deploy.yml b/docker-compose-deploy.yml index 5f32496..368336b 100644 --- a/docker-compose-deploy.yml +++ b/docker-compose-deploy.yml @@ -9,7 +9,7 @@ networks: services: web-app: - image: utility-bills-tracker:1.25.3 + image: utility-bills-tracker:1.25.4 networks: - traefik-network - mongo-network