From 766bdf6504681f6311a36734db101ec08e95cdae Mon Sep 17 00:00:00 2001 From: nascjoao Date: Mon, 20 May 2024 20:35:08 -0300 Subject: [PATCH 1/5] chore: add notifications dropdown to dictionary --- apps/web/src/utils/dictionaries/get-dictionaries.types.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/web/src/utils/dictionaries/get-dictionaries.types.ts b/apps/web/src/utils/dictionaries/get-dictionaries.types.ts index 90196b33..abf089a7 100644 --- a/apps/web/src/utils/dictionaries/get-dictionaries.types.ts +++ b/apps/web/src/utils/dictionaries/get-dictionaries.types.ts @@ -229,6 +229,10 @@ export type Dictionary = { collection_added_successfully: string view_list: string } + notifications_dropdown: { + notifications: string + no_notifications: string + } settings_dropdown: { theme: string light: string From b41976c1acca2b59d123fc703931e96aa1faf18c Mon Sep 17 00:00:00 2001 From: nascjoao Date: Mon, 20 May 2024 20:35:58 -0300 Subject: [PATCH 2/5] feat: add translations for notifications dropdown --- apps/web/public/dictionaries/de-DE.json | 4 ++++ apps/web/public/dictionaries/en-US.json | 4 ++++ apps/web/public/dictionaries/es-ES.json | 4 ++++ apps/web/public/dictionaries/fr-FR.json | 4 ++++ apps/web/public/dictionaries/it-IT.json | 4 ++++ apps/web/public/dictionaries/ja-JP.json | 4 ++++ apps/web/public/dictionaries/pt-BR.json | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/apps/web/public/dictionaries/de-DE.json b/apps/web/public/dictionaries/de-DE.json index f71d073c..0169bf8f 100644 --- a/apps/web/public/dictionaries/de-DE.json +++ b/apps/web/public/dictionaries/de-DE.json @@ -249,6 +249,10 @@ "collection_added_successfully": "Sammlung erfolgreich hinzugefügt.", "view_list": "Liste ansehen" }, + "notifications_dropdown": { + "notifications": "Benachrichtigungen", + "no_notifications": "Keine Benachrichtigungen gefunden." + }, "settings_dropdown": { "theme": "Thema", "light": "🌞 Hell", diff --git a/apps/web/public/dictionaries/en-US.json b/apps/web/public/dictionaries/en-US.json index 6543c57f..f38fc9d5 100644 --- a/apps/web/public/dictionaries/en-US.json +++ b/apps/web/public/dictionaries/en-US.json @@ -249,6 +249,10 @@ "collection_added_successfully": "Collection added successfully.", "view_list": "View list" }, + "notifications_dropdown": { + "notifications": "Notifications", + "no_notifications": "No notifications yet." + }, "settings_dropdown": { "theme": "Theme", "light": "🌞 Light", diff --git a/apps/web/public/dictionaries/es-ES.json b/apps/web/public/dictionaries/es-ES.json index e78751fa..bcaeacc1 100644 --- a/apps/web/public/dictionaries/es-ES.json +++ b/apps/web/public/dictionaries/es-ES.json @@ -249,6 +249,10 @@ "collection_added_successfully": "Colección añadida con éxito.", "view_list": "Ver lista" }, + "notifications_dropdown": { + "notifications": "Notificaciones", + "no_notifications": "No tienes notificaciones." + }, "settings_dropdown": { "theme": "Tema", "light": "🌞 Claro", diff --git a/apps/web/public/dictionaries/fr-FR.json b/apps/web/public/dictionaries/fr-FR.json index c6a1a8fa..10af1504 100644 --- a/apps/web/public/dictionaries/fr-FR.json +++ b/apps/web/public/dictionaries/fr-FR.json @@ -250,6 +250,10 @@ "collection_added_successfully": "Collection ajoutée avec succès.", "view_list": "Voir la liste" }, + "notifications_dropdown": { + "notifications": "Notifications", + "no_notifications": "Aucune notification trouvée." + }, "settings_dropdown": { "theme": "Thème", "light": "🌞 Clair", diff --git a/apps/web/public/dictionaries/it-IT.json b/apps/web/public/dictionaries/it-IT.json index 0b4f9d44..bea62fe8 100644 --- a/apps/web/public/dictionaries/it-IT.json +++ b/apps/web/public/dictionaries/it-IT.json @@ -250,6 +250,10 @@ "collection_added_successfully": "Collezione aggiunta con successo.", "view_list": "Visualizza lista" }, + "notifications_dropdown": { + "notifications": "Notifiche", + "no_notifications": "Nessuna notifica." + }, "settings_dropdown": { "theme": "Tema", "light": "🌞 Chiaro", diff --git a/apps/web/public/dictionaries/ja-JP.json b/apps/web/public/dictionaries/ja-JP.json index 0c76109c..d2460168 100644 --- a/apps/web/public/dictionaries/ja-JP.json +++ b/apps/web/public/dictionaries/ja-JP.json @@ -249,6 +249,10 @@ "collection_added_successfully": "コレクションが正常に追加されました。", "view_list": "リストを見る" }, + "notifications_dropdown": { + "notifications": "通知", + "no_notifications": "通知はありません。" + }, "settings_dropdown": { "theme": "テーマ", "light": "🌞 ライト", diff --git a/apps/web/public/dictionaries/pt-BR.json b/apps/web/public/dictionaries/pt-BR.json index 10b8dd9e..07ca9fb1 100644 --- a/apps/web/public/dictionaries/pt-BR.json +++ b/apps/web/public/dictionaries/pt-BR.json @@ -249,6 +249,10 @@ "collection_added_successfully": "Coleção adicionada com sucesso.", "view_list": "Ver lista" }, + "notifications_dropdown": { + "notifications": "Notificações", + "no_notifications": "Nenhuma notificação." + }, "settings_dropdown": { "theme": "Tema", "light": "🌞 Claro", From c7c145a8b632c9b202e7bb44fa3442c5d39d0091 Mon Sep 17 00:00:00 2001 From: nascjoao Date: Mon, 20 May 2024 20:36:49 -0300 Subject: [PATCH 3/5] feat: init NotificationsDropdown component --- .../notifications-dropdown/index.ts | 1 + .../notifications-dropdown.tsx | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 apps/web/src/components/notifications-dropdown/index.ts create mode 100644 apps/web/src/components/notifications-dropdown/notifications-dropdown.tsx diff --git a/apps/web/src/components/notifications-dropdown/index.ts b/apps/web/src/components/notifications-dropdown/index.ts new file mode 100644 index 00000000..71e0940b --- /dev/null +++ b/apps/web/src/components/notifications-dropdown/index.ts @@ -0,0 +1 @@ +export * from './notifications-dropdown' diff --git a/apps/web/src/components/notifications-dropdown/notifications-dropdown.tsx b/apps/web/src/components/notifications-dropdown/notifications-dropdown.tsx new file mode 100644 index 00000000..71b0223b --- /dev/null +++ b/apps/web/src/components/notifications-dropdown/notifications-dropdown.tsx @@ -0,0 +1,45 @@ +'use client' + +import { BellIcon } from 'lucide-react' + +import { Button } from '../ui/button' +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuTrigger, + DropdownMenuLabel, +} from '../ui/dropdown-menu' +import { useLanguage } from '@/context/language' + +export const NotificationsDropdown = () => { + const { dictionary } = useLanguage() + + return ( + + + + + + + + + {dictionary.notifications_dropdown.notifications} + +
+ +

+ {dictionary.notifications_dropdown.no_notifications} +

+
+
+
+
+ ) +} From 7421e1acdb3b48e511d48972ed75433cb98cbdd0 Mon Sep 17 00:00:00 2001 From: nascjoao Date: Mon, 20 May 2024 20:37:00 -0300 Subject: [PATCH 4/5] feat: add NotificationsDropdown component to header --- apps/web/src/components/header/header.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/web/src/components/header/header.tsx b/apps/web/src/components/header/header.tsx index f889655b..127c83e8 100644 --- a/apps/web/src/components/header/header.tsx +++ b/apps/web/src/components/header/header.tsx @@ -2,6 +2,7 @@ import { CommandSearch } from '../command-search' import { SettingsDropdown } from '../settings-dropdown' +import { NotificationsDropdown } from '../notifications-dropdown' import { HeaderNavigationMenu } from './header-navigation-menu' import { HeaderNavigationDrawer } from './header-navigation-drawer' import { Logo } from '../logo' @@ -18,6 +19,9 @@ export const Header = () => {
+
+ +
From f3a7a439e43ae34c40f05318622b604de37bddd3 Mon Sep 17 00:00:00 2001 From: nascjoao Date: Mon, 20 May 2024 20:47:22 -0300 Subject: [PATCH 5/5] refactor: update line-clamp and text alignment in NotificationsDropdown --- .../notifications-dropdown/notifications-dropdown.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/components/notifications-dropdown/notifications-dropdown.tsx b/apps/web/src/components/notifications-dropdown/notifications-dropdown.tsx index 71b0223b..3711922d 100644 --- a/apps/web/src/components/notifications-dropdown/notifications-dropdown.tsx +++ b/apps/web/src/components/notifications-dropdown/notifications-dropdown.tsx @@ -34,7 +34,7 @@ export const NotificationsDropdown = () => { width={40} height={40} /> -

+

{dictionary.notifications_dropdown.no_notifications}