From d57f3ec4869774a0d469c2f4295fba952b4d16e6 Mon Sep 17 00:00:00 2001 From: Sonny Date: Sun, 17 Aug 2025 00:47:13 +0200 Subject: [PATCH] feat: update user dropdown items --- .../common/floating_navbar/user_dropdown.tsx | 23 ++-- inertia/i18n/locales/en/common.json | 119 +++++++++--------- inertia/i18n/locales/fr/common.json | 119 +++++++++--------- 3 files changed, 129 insertions(+), 132 deletions(-) diff --git a/inertia/components/common/floating_navbar/user_dropdown.tsx b/inertia/components/common/floating_navbar/user_dropdown.tsx index f7847ec..627e0ea 100644 --- a/inertia/components/common/floating_navbar/user_dropdown.tsx +++ b/inertia/components/common/floating_navbar/user_dropdown.tsx @@ -2,8 +2,7 @@ import { Avatar, Group, Menu, Text, UnstyledButton } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; import cx from 'clsx'; import { useTranslation } from 'react-i18next'; -import { TbChevronDown, TbLogout, TbUser } from 'react-icons/tb'; -import { InternalLink } from '~/components/common/links/internal_link'; +import { TbChevronDown, TbLogout, TbShield } from 'react-icons/tb'; import { InternalLinkUnstyled } from '~/components/common/links/internal_link_unstyled'; import { useAuth } from '~/hooks/use_auth'; import classes from './user_dropdown.module.css'; @@ -41,20 +40,17 @@ export function UserDropdown() { - {t('common:user')} - } - component={InternalLinkUnstyled} - href={`/user/${auth.user?.fullname}`} - color="inherit" - > - {t('common:profile')} - - {auth.user?.isAdmin && ( <> {t('common:admin')} - {t('common:admin')} + } + component={InternalLinkUnstyled} + href="/admin" + color="red" + > + {t('common:manage_users')} + )} @@ -63,7 +59,6 @@ export function UserDropdown() { leftSection={} component={InternalLinkUnstyled} href="/auth/logout" - color="inherit" > {t('common:logout')} diff --git a/inertia/i18n/locales/en/common.json b/inertia/i18n/locales/en/common.json index a60840d..043d9c5 100644 --- a/inertia/i18n/locales/en/common.json +++ b/inertia/i18n/locales/en/common.json @@ -1,35 +1,35 @@ { - "slogan": "Manage your links in the best possible way", - "confirm": "Confirm", - "cancel": "Cancel", + "slogan": "Manage your links in the best possible way", + "confirm": "Confirm", + "cancel": "Cancel", "home": "Home", - "back-home": "← Back to home", - "logout": "Logout", - "login": "Login", - "link": { - "links": "Links", - "link": "Link URL", - "name": "Link name", - "description": "Link description", - "create": "Create a link", - "edit": "Edit a link", - "delete": "Delete a link", - "delete-confirm": "Confirm deletion?" - }, - "collection": { - "collections": "Collection", - "collections_other": "Collections", - "name": "Collection name", - "description": "Collection description", - "no-description": "No description", - "visibility": "Public", - "create": "Create a collection", - "edit": "Edit a collection", - "delete": "Delete a collection", - "delete-confirm": "Confirm deletion?", - "delete-description": "You must delete all links in this collection before you can delete this collection.", + "back-home": "← Back to home", + "logout": "Logout", + "login": "Login", + "link": { + "links": "Links", + "link": "Link URL", + "name": "Link name", + "description": "Link description", + "create": "Create a link", + "edit": "Edit a link", + "delete": "Delete a link", + "delete-confirm": "Confirm deletion?" + }, + "collection": { + "collections": "Collection", + "collections_other": "Collections", + "name": "Collection name", + "description": "Collection description", + "no-description": "No description", + "visibility": "Public", + "create": "Create a collection", + "edit": "Edit a collection", + "delete": "Delete a collection", + "delete-confirm": "Confirm deletion?", + "delete-description": "You must delete all links in this collection before you can delete this collection.", "managed-by": "Collection managed by {{name}}" - }, + }, "form": { "name": "Name", "description": "Description", @@ -49,38 +49,39 @@ "private": "Privé", "public": "Public" }, - "favorite": "Favorite", - "add-favorite": "Add to favorites", - "remove-favorite": "Remove from favorites", - "favorites-appears-here": "Your favorites will appear here", - "go-to-collection": "Go to collection", - "no-item-found": "No item found", - "admin": "Administrator", + "favorite": "Favorite", + "add-favorite": "Add to favorites", + "remove-favorite": "Remove from favorites", + "favorites-appears-here": "Your favorites will appear here", + "go-to-collection": "Go to collection", + "no-item-found": "No item found", + "admin": "Admin", + "manage_users": "Manage users", "user": "User", - "search": "Search", - "search-with": "Search with", - "avatar": "{{name}}'s avatar", - "generic-error": "Something went wrong", - "generic-error-description": "An error has occurred, if this happens again please create an issue with as much detail as possible.", - "retry": "Retry", - "privacy": "Privacy", - "terms": "Terms of use", - "language": { - "fr": "Français", - "en": "English" - }, - "lang": "Language", - "settings": "Settings", - "profile": "Profile", - "select-your-lang": "Change the language", - "name": "Name", - "email": "Email", - "member-since": "Member since", - "footer": { - "made_by": "Made with ❤\uFE0F by" - }, + "search": "Search", + "search-with": "Search with", + "avatar": "{{name}}'s avatar", + "generic-error": "Something went wrong", + "generic-error-description": "An error has occurred, if this happens again please create an issue with as much detail as possible.", + "retry": "Retry", + "privacy": "Privacy", + "terms": "Terms of use", + "language": { + "fr": "Français", + "en": "English" + }, + "lang": "Language", + "settings": "Settings", + "profile": "Profile", + "select-your-lang": "Change the language", + "name": "Name", + "email": "Email", + "member-since": "Member since", + "footer": { + "made_by": "Made with ❤\uFE0F by" + }, "loading": "Loading...", "no-results": "No results found", "click-to-copy": "Click on the following link to copy the shareable url", "success-copy": "Link copied to clipboard" -} \ No newline at end of file +} diff --git a/inertia/i18n/locales/fr/common.json b/inertia/i18n/locales/fr/common.json index afdd88b..d585ac3 100644 --- a/inertia/i18n/locales/fr/common.json +++ b/inertia/i18n/locales/fr/common.json @@ -1,35 +1,35 @@ { - "slogan": "Gérez vos liens de la meilleure des façons", - "confirm": "Confirmer", - "cancel": "Annuler", + "slogan": "Gérez vos liens de la meilleure des façons", + "confirm": "Confirmer", + "cancel": "Annuler", "home": "Accueil", - "back-home": "← Revenir à l'accueil", - "logout": "Déconnexion", - "login": "Connexion", - "link": { - "links": "Liens", - "link": "URL du lien", - "name": "Nom du lien", - "description": "Description du lien", - "create": "Créer un lien", - "edit": "Modifier un lien", - "delete": "Supprimer un lien", - "delete-confirm": "Confirmer la suppression ?" - }, - "collection": { - "collections": "Collection", - "collections_other": "Collections", - "name": "Nom de la collection", - "description": "Description de la collection", - "no-description": "Aucune description", - "visibility": "Public", - "create": "Créer une collection", - "edit": "Modifier une collection", - "delete": "Supprimer une collection", - "delete-confirm": "Confirmer la suppression ?", - "delete-description": "Vous devez supprimer tous les liens de cette collection avant de pouvoir supprimer cette collection", + "back-home": "← Revenir à l'accueil", + "logout": "Déconnexion", + "login": "Connexion", + "link": { + "links": "Liens", + "link": "URL du lien", + "name": "Nom du lien", + "description": "Description du lien", + "create": "Créer un lien", + "edit": "Modifier un lien", + "delete": "Supprimer un lien", + "delete-confirm": "Confirmer la suppression ?" + }, + "collection": { + "collections": "Collection", + "collections_other": "Collections", + "name": "Nom de la collection", + "description": "Description de la collection", + "no-description": "Aucune description", + "visibility": "Public", + "create": "Créer une collection", + "edit": "Modifier une collection", + "delete": "Supprimer une collection", + "delete-confirm": "Confirmer la suppression ?", + "delete-description": "Vous devez supprimer tous les liens de cette collection avant de pouvoir supprimer cette collection", "managed-by": "Collection gérée par {{name}}" - }, + }, "form": { "name": "Nom", "description": "Description", @@ -49,38 +49,39 @@ "private": "Privé", "public": "Public" }, - "favorite": "Favoris", - "add-favorite": "Ajouter aux favoris", - "remove-favorite": "Retirer des favoris", - "favorites-appears-here": "Vos favoris apparaîtront ici", - "go-to-collection": "Voir la collection", - "no-item-found": "Aucun élément trouvé", - "admin": "Administrateur", + "favorite": "Favoris", + "add-favorite": "Ajouter aux favoris", + "remove-favorite": "Retirer des favoris", + "favorites-appears-here": "Vos favoris apparaîtront ici", + "go-to-collection": "Voir la collection", + "no-item-found": "Aucun élément trouvé", + "admin": "Admin", + "manage_users": "Gestion utilisateurs", "user": "Utilisateur", - "search": "Rechercher", - "search-with": "Rechercher avec", - "avatar": "Avatar de {{name}}", - "generic-error": "Une erreur est survenue", - "generic-error-description": "Une erreur est survenue, si cela se reproduit merci de créer une issue avec le maximum de détails.", - "retry": "Recommencer", - "privacy": "Confidentialité", - "terms": "CGU", - "language": { - "fr": "Français", - "en": "English" - }, - "lang": "Langage", - "settings": "Paramètres", - "profile": "Profil", - "select-your-lang": "Modifier la langue", - "name": "Nom", - "email": "Email", - "member-since": "Membre depuis", - "footer": { - "made_by": "Fait avec ❤\uFE0F par" - }, + "search": "Rechercher", + "search-with": "Rechercher avec", + "avatar": "Avatar de {{name}}", + "generic-error": "Une erreur est survenue", + "generic-error-description": "Une erreur est survenue, si cela se reproduit merci de créer une issue avec le maximum de détails.", + "retry": "Recommencer", + "privacy": "Confidentialité", + "terms": "CGU", + "language": { + "fr": "Français", + "en": "English" + }, + "lang": "Langage", + "settings": "Paramètres", + "profile": "Profil", + "select-your-lang": "Modifier la langue", + "name": "Nom", + "email": "Email", + "member-since": "Membre depuis", + "footer": { + "made_by": "Fait avec ❤\uFE0F par" + }, "loading": "Chargement...", "no-results": "Aucun résultat trouvé", "click-to-copy": "Cliquez sur le lien suivant pour copier l'URL partageable", "success-copy": "Link copié dans le presse-papiers" -} \ No newline at end of file +}