From b0431ff962012d9f1d44da4c619cb137e8fc879a Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 6 Apr 2025 16:24:05 +0200 Subject: [PATCH] feat(frontend): global notices --- Foxnouns.Backend/Program.cs | 1 + .../src/lib/components/GlobalNotice.svelte | 49 +++++++++++++++++++ .../components/settings/Notification.svelte | 2 +- .../src/lib/i18n/locales/en.json | 4 +- Foxnouns.Frontend/src/routes/+page.svelte | 10 ++++ .../src/routes/settings/+layout.svelte | 17 ++++++- .../settings/notifications/+page.svelte | 3 +- 7 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 Foxnouns.Frontend/src/lib/components/GlobalNotice.svelte diff --git a/Foxnouns.Backend/Program.cs b/Foxnouns.Backend/Program.cs index f27ad50..b266248 100644 --- a/Foxnouns.Backend/Program.cs +++ b/Foxnouns.Backend/Program.cs @@ -68,6 +68,7 @@ builder { NamingStrategy = new SnakeCaseNamingStrategy(), }; + options.SerializerSettings.DateParseHandling = DateParseHandling.None; }) .ConfigureApiBehaviorOptions(options => { diff --git a/Foxnouns.Frontend/src/lib/components/GlobalNotice.svelte b/Foxnouns.Frontend/src/lib/components/GlobalNotice.svelte new file mode 100644 index 0000000..3d1c718 --- /dev/null +++ b/Foxnouns.Frontend/src/lib/components/GlobalNotice.svelte @@ -0,0 +1,49 @@ + + +{#if renderNotice} + +{/if} diff --git a/Foxnouns.Frontend/src/lib/components/settings/Notification.svelte b/Foxnouns.Frontend/src/lib/components/settings/Notification.svelte index c452f4c..796d60a 100644 --- a/Foxnouns.Frontend/src/lib/components/settings/Notification.svelte +++ b/Foxnouns.Frontend/src/lib/components/settings/Notification.svelte @@ -38,6 +38,6 @@ diff --git a/Foxnouns.Frontend/src/lib/i18n/locales/en.json b/Foxnouns.Frontend/src/lib/i18n/locales/en.json index 9f54943..dc74d2f 100644 --- a/Foxnouns.Frontend/src/lib/i18n/locales/en.json +++ b/Foxnouns.Frontend/src/lib/i18n/locales/en.json @@ -350,6 +350,8 @@ "notification": { "suspension": "Your account has been suspended for the following reason: {{reason}}", "warning": "You have been warned for the following reason: {{reason}}", - "warning-cleared-fields": "You have been warned for the following reason: {{reason}}\n\nAdditionally, the following fields have been cleared from your profile:\n{{clearedFields}}" + "warning-cleared-fields": "You have been warned for the following reason: {{reason}}\n\nAdditionally, the following fields have been cleared from your profile:\n{{clearedFields}}", + "mark-as-read": "Mark as read", + "no-notifications": "You have no notifications." } } diff --git a/Foxnouns.Frontend/src/routes/+page.svelte b/Foxnouns.Frontend/src/routes/+page.svelte index 47ab0e5..4fd36dc 100644 --- a/Foxnouns.Frontend/src/routes/+page.svelte +++ b/Foxnouns.Frontend/src/routes/+page.svelte @@ -1,4 +1,5 @@ {$t("title.settings")} • pronouns.cc +{#if data.meta.notice} +
+ +
+{/if} +