Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Notifications #176

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/web/public/dictionaries/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@
"collection_removed_successfully": "Sammlung erfolgreich entfernt.",
"collection_added_successfully": "Sammlung erfolgreich hinzugefügt."
},
"notifications_dropdown": {
"notifications": "Benachrichtigungen",
"no_notifications": "Keine Benachrichtigungen gefunden."
},
"settings_dropdown": {
"theme": "Thema",
"light": "🌞 Hell",
Expand Down
4 changes: 4 additions & 0 deletions apps/web/public/dictionaries/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@
"collection_removed_successfully": "Collection removed successfully.",
"collection_added_successfully": "Collection added successfully."
},
"notifications_dropdown": {
"notifications": "Notifications",
"no_notifications": "No notifications yet."
},
"settings_dropdown": {
"theme": "Theme",
"light": "🌞 Light",
Expand Down
4 changes: 4 additions & 0 deletions apps/web/public/dictionaries/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@
"collection_removed_successfully": "Colección eliminada con éxito.",
"collection_added_successfully": "Colección añadida con éxito."
},
"notifications_dropdown": {
"notifications": "Notificaciones",
"no_notifications": "No tienes notificaciones."
},
"settings_dropdown": {
"theme": "Tema",
"light": "🌞 Claro",
Expand Down
4 changes: 4 additions & 0 deletions apps/web/public/dictionaries/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@
"collection_removed_successfully": "Collection supprimée avec succès.",
"collection_added_successfully": "Collection ajoutée avec succès."
},
"notifications_dropdown": {
"notifications": "Notifications",
"no_notifications": "Aucune notification trouvée."
},
"settings_dropdown": {
"theme": "Thème",
"light": "🌞 Clair",
Expand Down
4 changes: 4 additions & 0 deletions apps/web/public/dictionaries/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@
"collection_removed_successfully": "Collezione rimossa con successo.",
"collection_added_successfully": "Collezione aggiunta con successo."
},
"notifications_dropdown": {
"notifications": "Notifiche",
"no_notifications": "Nessuna notifica."
},
"settings_dropdown": {
"theme": "Tema",
"light": "🌞 Chiaro",
Expand Down
4 changes: 4 additions & 0 deletions apps/web/public/dictionaries/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@
"collection_removed_successfully": "コレクションが正常に削除されました。",
"collection_added_successfully": "コレクションが正常に追加されました。"
},
"notifications_dropdown": {
"notifications": "通知",
"no_notifications": "通知はありません。"
},
"settings_dropdown": {
"theme": "テーマ",
"light": "🌞 ライト",
Expand Down
4 changes: 4 additions & 0 deletions apps/web/public/dictionaries/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@
"collection_removed_successfully": "Coleção removida com sucesso.",
"collection_added_successfully": "Coleção adicionada com sucesso."
},
"notifications_dropdown": {
"notifications": "Notificações",
"no_notifications": "Nenhuma notificação."
},
"settings_dropdown": {
"theme": "Tema",
"light": "🌞 Claro",
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -17,6 +18,7 @@ export const Header = () => {

<div className="flex gap-2">
<CommandSearch />
<NotificationsDropdown />
<SettingsDropdown />
</div>
</header>
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/components/notifications-dropdown/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './notifications-dropdown'
Original file line number Diff line number Diff line change
@@ -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 (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" size="icon">
<BellIcon width={16} height={16} />
</Button>
</DropdownMenuTrigger>

<DropdownMenuContent align="start">
<DropdownMenuGroup>
<DropdownMenuLabel>
{dictionary.notifications_dropdown.notifications}
</DropdownMenuLabel>
<div className="mt-2 grid justify-items-center gap-3 px-2 py-1.5">
<BellIcon
className="text-muted-foreground"
width={40}
height={40}
/>
<p className="line-clamp-3 text-center text-xs text-muted-foreground">
{dictionary.notifications_dropdown.no_notifications}
</p>
</div>
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
)
}
4 changes: 4 additions & 0 deletions apps/web/src/utils/dictionaries/get-dictionaries.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ export type Dictionary = {
collection_removed_successfully: string
collection_added_successfully: string
}
notifications_dropdown: {
notifications: string
no_notifications: string
}
settings_dropdown: {
theme: string
light: string
Expand Down