From 5111f3574f963e24722d36ef9a89fc3a95f5bd4f Mon Sep 17 00:00:00 2001 From: Sebastian Goscinski <22999200+sebiweise@users.noreply.github.com> Date: Sat, 7 Dec 2024 17:07:54 +0100 Subject: [PATCH] Feature: Default currency symbol (#259) * Added a env parameter to define a default currency symbol * Fixed prettier formatting --- .env.example | 4 +++- src/components/group-form.tsx | 2 +- src/lib/env.ts | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index bc38b5f..b4e87f5 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,4 @@ POSTGRES_PRISMA_URL=postgresql://postgres:1234@localhost -POSTGRES_URL_NON_POOLING=postgresql://postgres:1234@localhost \ No newline at end of file +POSTGRES_URL_NON_POOLING=postgresql://postgres:1234@localhost + +NEXT_PUBLIC_DEFAULT_CURRENCY_SYMBOL="" \ No newline at end of file diff --git a/src/components/group-form.tsx b/src/components/group-form.tsx index b4ed858..8588bdf 100644 --- a/src/components/group-form.tsx +++ b/src/components/group-form.tsx @@ -67,7 +67,7 @@ export function GroupForm({ : { name: '', information: '', - currency: '', + currency: process.env.NEXT_PUBLIC_DEFAULT_CURRENCY_SYMBOL || '', participants: [ { name: t('Participants.John') }, { name: t('Participants.Jane') }, diff --git a/src/lib/env.ts b/src/lib/env.ts index 920df14..de28453 100644 --- a/src/lib/env.ts +++ b/src/lib/env.ts @@ -21,6 +21,7 @@ const envSchema = z interpretEnvVarAsBool, z.boolean().default(false), ), + NEXT_PUBLIC_DEFAULT_CURRENCY_SYMBOL: z.string().optional(), S3_UPLOAD_KEY: z.string().optional(), S3_UPLOAD_SECRET: z.string().optional(), S3_UPLOAD_BUCKET: z.string().optional(),