mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 22:53:25 +00:00
feat: update user dropdown items
This commit is contained in:
@@ -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() {
|
||||
</UnstyledButton>
|
||||
</Menu.Target>
|
||||
<Menu.Dropdown>
|
||||
<Menu.Label>{t('common:user')}</Menu.Label>
|
||||
<Menu.Item
|
||||
leftSection={<TbUser size={16} />}
|
||||
component={InternalLinkUnstyled}
|
||||
href={`/user/${auth.user?.fullname}`}
|
||||
color="inherit"
|
||||
>
|
||||
{t('common:profile')}
|
||||
</Menu.Item>
|
||||
|
||||
{auth.user?.isAdmin && (
|
||||
<>
|
||||
<Menu.Label>{t('common:admin')}</Menu.Label>
|
||||
<InternalLink href="/admin">{t('common:admin')}</InternalLink>
|
||||
<Menu.Item
|
||||
leftSection={<TbShield size={16} />}
|
||||
component={InternalLinkUnstyled}
|
||||
href="/admin"
|
||||
color="red"
|
||||
>
|
||||
{t('common:manage_users')}
|
||||
</Menu.Item>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -63,7 +59,6 @@ export function UserDropdown() {
|
||||
leftSection={<TbLogout size={16} />}
|
||||
component={InternalLinkUnstyled}
|
||||
href="/auth/logout"
|
||||
color="inherit"
|
||||
>
|
||||
{t('common:logout')}
|
||||
</Menu.Item>
|
||||
|
||||
@@ -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 <b>{{name}}</b>"
|
||||
},
|
||||
},
|
||||
"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 <a href=\"https://github.com/Sonny93/my-links\" target=\"_blank\">create an issue</a> 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 <a href=\"https://github.com/Sonny93/my-links\" target=\"_blank\">create an issue</a> 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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 <b>{{name}}</b>"
|
||||
},
|
||||
},
|
||||
"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 <a href=\"https://github.com/Sonny93/my-links\" target=\"_blank\">créer une issue</a> 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 <a href=\"https://github.com/Sonny93/my-links\" target=\"_blank\">créer une issue</a> 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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user