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 { useDisclosure } from '@mantine/hooks';
|
||||||
import cx from 'clsx';
|
import cx from 'clsx';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { TbChevronDown, TbLogout, TbUser } from 'react-icons/tb';
|
import { TbChevronDown, TbLogout, TbShield } from 'react-icons/tb';
|
||||||
import { InternalLink } from '~/components/common/links/internal_link';
|
|
||||||
import { InternalLinkUnstyled } from '~/components/common/links/internal_link_unstyled';
|
import { InternalLinkUnstyled } from '~/components/common/links/internal_link_unstyled';
|
||||||
import { useAuth } from '~/hooks/use_auth';
|
import { useAuth } from '~/hooks/use_auth';
|
||||||
import classes from './user_dropdown.module.css';
|
import classes from './user_dropdown.module.css';
|
||||||
@@ -41,20 +40,17 @@ export function UserDropdown() {
|
|||||||
</UnstyledButton>
|
</UnstyledButton>
|
||||||
</Menu.Target>
|
</Menu.Target>
|
||||||
<Menu.Dropdown>
|
<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 && (
|
{auth.user?.isAdmin && (
|
||||||
<>
|
<>
|
||||||
<Menu.Label>{t('common:admin')}</Menu.Label>
|
<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} />}
|
leftSection={<TbLogout size={16} />}
|
||||||
component={InternalLinkUnstyled}
|
component={InternalLinkUnstyled}
|
||||||
href="/auth/logout"
|
href="/auth/logout"
|
||||||
color="inherit"
|
|
||||||
>
|
>
|
||||||
{t('common:logout')}
|
{t('common:logout')}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
{
|
{
|
||||||
"slogan": "Manage your links in the best possible way",
|
"slogan": "Manage your links in the best possible way",
|
||||||
"confirm": "Confirm",
|
"confirm": "Confirm",
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"home": "Home",
|
"home": "Home",
|
||||||
"back-home": "← Back to home",
|
"back-home": "← Back to home",
|
||||||
"logout": "Logout",
|
"logout": "Logout",
|
||||||
"login": "Login",
|
"login": "Login",
|
||||||
"link": {
|
"link": {
|
||||||
"links": "Links",
|
"links": "Links",
|
||||||
"link": "Link URL",
|
"link": "Link URL",
|
||||||
"name": "Link name",
|
"name": "Link name",
|
||||||
"description": "Link description",
|
"description": "Link description",
|
||||||
"create": "Create a link",
|
"create": "Create a link",
|
||||||
"edit": "Edit a link",
|
"edit": "Edit a link",
|
||||||
"delete": "Delete a link",
|
"delete": "Delete a link",
|
||||||
"delete-confirm": "Confirm deletion?"
|
"delete-confirm": "Confirm deletion?"
|
||||||
},
|
},
|
||||||
"collection": {
|
"collection": {
|
||||||
"collections": "Collection",
|
"collections": "Collection",
|
||||||
"collections_other": "Collections",
|
"collections_other": "Collections",
|
||||||
"name": "Collection name",
|
"name": "Collection name",
|
||||||
"description": "Collection description",
|
"description": "Collection description",
|
||||||
"no-description": "No description",
|
"no-description": "No description",
|
||||||
"visibility": "Public",
|
"visibility": "Public",
|
||||||
"create": "Create a collection",
|
"create": "Create a collection",
|
||||||
"edit": "Edit a collection",
|
"edit": "Edit a collection",
|
||||||
"delete": "Delete a collection",
|
"delete": "Delete a collection",
|
||||||
"delete-confirm": "Confirm deletion?",
|
"delete-confirm": "Confirm deletion?",
|
||||||
"delete-description": "You must delete all links in this collection before you can delete this collection.",
|
"delete-description": "You must delete all links in this collection before you can delete this collection.",
|
||||||
"managed-by": "Collection managed by <b>{{name}}</b>"
|
"managed-by": "Collection managed by <b>{{name}}</b>"
|
||||||
},
|
},
|
||||||
"form": {
|
"form": {
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"description": "Description",
|
"description": "Description",
|
||||||
@@ -49,36 +49,37 @@
|
|||||||
"private": "Privé",
|
"private": "Privé",
|
||||||
"public": "Public"
|
"public": "Public"
|
||||||
},
|
},
|
||||||
"favorite": "Favorite",
|
"favorite": "Favorite",
|
||||||
"add-favorite": "Add to favorites",
|
"add-favorite": "Add to favorites",
|
||||||
"remove-favorite": "Remove from favorites",
|
"remove-favorite": "Remove from favorites",
|
||||||
"favorites-appears-here": "Your favorites will appear here",
|
"favorites-appears-here": "Your favorites will appear here",
|
||||||
"go-to-collection": "Go to collection",
|
"go-to-collection": "Go to collection",
|
||||||
"no-item-found": "No item found",
|
"no-item-found": "No item found",
|
||||||
"admin": "Administrator",
|
"admin": "Admin",
|
||||||
|
"manage_users": "Manage users",
|
||||||
"user": "User",
|
"user": "User",
|
||||||
"search": "Search",
|
"search": "Search",
|
||||||
"search-with": "Search with",
|
"search-with": "Search with",
|
||||||
"avatar": "{{name}}'s avatar",
|
"avatar": "{{name}}'s avatar",
|
||||||
"generic-error": "Something went wrong",
|
"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.",
|
"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",
|
"retry": "Retry",
|
||||||
"privacy": "Privacy",
|
"privacy": "Privacy",
|
||||||
"terms": "Terms of use",
|
"terms": "Terms of use",
|
||||||
"language": {
|
"language": {
|
||||||
"fr": "Français",
|
"fr": "Français",
|
||||||
"en": "English"
|
"en": "English"
|
||||||
},
|
},
|
||||||
"lang": "Language",
|
"lang": "Language",
|
||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
"profile": "Profile",
|
"profile": "Profile",
|
||||||
"select-your-lang": "Change the language",
|
"select-your-lang": "Change the language",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"email": "Email",
|
"email": "Email",
|
||||||
"member-since": "Member since",
|
"member-since": "Member since",
|
||||||
"footer": {
|
"footer": {
|
||||||
"made_by": "Made with ❤\uFE0F by"
|
"made_by": "Made with ❤\uFE0F by"
|
||||||
},
|
},
|
||||||
"loading": "Loading...",
|
"loading": "Loading...",
|
||||||
"no-results": "No results found",
|
"no-results": "No results found",
|
||||||
"click-to-copy": "Click on the following link to copy the shareable url",
|
"click-to-copy": "Click on the following link to copy the shareable url",
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
{
|
{
|
||||||
"slogan": "Gérez vos liens de la meilleure des façons",
|
"slogan": "Gérez vos liens de la meilleure des façons",
|
||||||
"confirm": "Confirmer",
|
"confirm": "Confirmer",
|
||||||
"cancel": "Annuler",
|
"cancel": "Annuler",
|
||||||
"home": "Accueil",
|
"home": "Accueil",
|
||||||
"back-home": "← Revenir à l'accueil",
|
"back-home": "← Revenir à l'accueil",
|
||||||
"logout": "Déconnexion",
|
"logout": "Déconnexion",
|
||||||
"login": "Connexion",
|
"login": "Connexion",
|
||||||
"link": {
|
"link": {
|
||||||
"links": "Liens",
|
"links": "Liens",
|
||||||
"link": "URL du lien",
|
"link": "URL du lien",
|
||||||
"name": "Nom du lien",
|
"name": "Nom du lien",
|
||||||
"description": "Description du lien",
|
"description": "Description du lien",
|
||||||
"create": "Créer un lien",
|
"create": "Créer un lien",
|
||||||
"edit": "Modifier un lien",
|
"edit": "Modifier un lien",
|
||||||
"delete": "Supprimer un lien",
|
"delete": "Supprimer un lien",
|
||||||
"delete-confirm": "Confirmer la suppression ?"
|
"delete-confirm": "Confirmer la suppression ?"
|
||||||
},
|
},
|
||||||
"collection": {
|
"collection": {
|
||||||
"collections": "Collection",
|
"collections": "Collection",
|
||||||
"collections_other": "Collections",
|
"collections_other": "Collections",
|
||||||
"name": "Nom de la collection",
|
"name": "Nom de la collection",
|
||||||
"description": "Description de la collection",
|
"description": "Description de la collection",
|
||||||
"no-description": "Aucune description",
|
"no-description": "Aucune description",
|
||||||
"visibility": "Public",
|
"visibility": "Public",
|
||||||
"create": "Créer une collection",
|
"create": "Créer une collection",
|
||||||
"edit": "Modifier une collection",
|
"edit": "Modifier une collection",
|
||||||
"delete": "Supprimer une collection",
|
"delete": "Supprimer une collection",
|
||||||
"delete-confirm": "Confirmer la suppression ?",
|
"delete-confirm": "Confirmer la suppression ?",
|
||||||
"delete-description": "Vous devez supprimer tous les liens de cette collection avant de pouvoir supprimer cette collection",
|
"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>"
|
"managed-by": "Collection gérée par <b>{{name}}</b>"
|
||||||
},
|
},
|
||||||
"form": {
|
"form": {
|
||||||
"name": "Nom",
|
"name": "Nom",
|
||||||
"description": "Description",
|
"description": "Description",
|
||||||
@@ -49,36 +49,37 @@
|
|||||||
"private": "Privé",
|
"private": "Privé",
|
||||||
"public": "Public"
|
"public": "Public"
|
||||||
},
|
},
|
||||||
"favorite": "Favoris",
|
"favorite": "Favoris",
|
||||||
"add-favorite": "Ajouter aux favoris",
|
"add-favorite": "Ajouter aux favoris",
|
||||||
"remove-favorite": "Retirer des favoris",
|
"remove-favorite": "Retirer des favoris",
|
||||||
"favorites-appears-here": "Vos favoris apparaîtront ici",
|
"favorites-appears-here": "Vos favoris apparaîtront ici",
|
||||||
"go-to-collection": "Voir la collection",
|
"go-to-collection": "Voir la collection",
|
||||||
"no-item-found": "Aucun élément trouvé",
|
"no-item-found": "Aucun élément trouvé",
|
||||||
"admin": "Administrateur",
|
"admin": "Admin",
|
||||||
|
"manage_users": "Gestion utilisateurs",
|
||||||
"user": "Utilisateur",
|
"user": "Utilisateur",
|
||||||
"search": "Rechercher",
|
"search": "Rechercher",
|
||||||
"search-with": "Rechercher avec",
|
"search-with": "Rechercher avec",
|
||||||
"avatar": "Avatar de {{name}}",
|
"avatar": "Avatar de {{name}}",
|
||||||
"generic-error": "Une erreur est survenue",
|
"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.",
|
"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",
|
"retry": "Recommencer",
|
||||||
"privacy": "Confidentialité",
|
"privacy": "Confidentialité",
|
||||||
"terms": "CGU",
|
"terms": "CGU",
|
||||||
"language": {
|
"language": {
|
||||||
"fr": "Français",
|
"fr": "Français",
|
||||||
"en": "English"
|
"en": "English"
|
||||||
},
|
},
|
||||||
"lang": "Langage",
|
"lang": "Langage",
|
||||||
"settings": "Paramètres",
|
"settings": "Paramètres",
|
||||||
"profile": "Profil",
|
"profile": "Profil",
|
||||||
"select-your-lang": "Modifier la langue",
|
"select-your-lang": "Modifier la langue",
|
||||||
"name": "Nom",
|
"name": "Nom",
|
||||||
"email": "Email",
|
"email": "Email",
|
||||||
"member-since": "Membre depuis",
|
"member-since": "Membre depuis",
|
||||||
"footer": {
|
"footer": {
|
||||||
"made_by": "Fait avec ❤\uFE0F par"
|
"made_by": "Fait avec ❤\uFE0F par"
|
||||||
},
|
},
|
||||||
"loading": "Chargement...",
|
"loading": "Chargement...",
|
||||||
"no-results": "Aucun résultat trouvé",
|
"no-results": "Aucun résultat trouvé",
|
||||||
"click-to-copy": "Cliquez sur le lien suivant pour copier l'URL partageable",
|
"click-to-copy": "Cliquez sur le lien suivant pour copier l'URL partageable",
|
||||||
|
|||||||
Reference in New Issue
Block a user