diff --git a/src/frontend/src/features/settings/components/SettingsDialog.tsx b/src/frontend/src/features/settings/components/SettingsDialog.tsx index ea4aabfa..079a5699 100644 --- a/src/frontend/src/features/settings/components/SettingsDialog.tsx +++ b/src/frontend/src/features/settings/components/SettingsDialog.tsx @@ -1,14 +1,38 @@ -import { useTranslation } from 'react-i18next' +import { Trans, useTranslation } from 'react-i18next' import { useLanguageLabels } from '@/i18n/useLanguageLabels' -import { Dialog, type DialogProps, Field, H } from '@/primitives' +import { A, Badge, Dialog, type DialogProps, Field, H, P } from '@/primitives' +import { authUrl, logoutUrl, useUser } from '@/features/auth' export type SettingsDialogProps = Pick export const SettingsDialog = (props: SettingsDialogProps) => { const { t, i18n } = useTranslation('settings') + const { user, isLoggedIn } = useUser() const { languagesList, currentLanguage } = useLanguageLabels() return ( + {t('account.heading')} + {isLoggedIn ? ( + <> +

+ ]} + /> +

+

+ {t('logout', { ns: 'global' })} +

+ + ) : ( + <> +

{t('account.youAreNotLoggedIn')}

+

+ {t('login', { ns: 'global' })} +

+ + )} {t('language.heading')} {{user}}", + "heading": "Account", + "youAreNotLoggedIn": "You are not logged in." + }, "dialog": { "heading": "Settings" }, diff --git a/src/frontend/src/locales/fr/settings.json b/src/frontend/src/locales/fr/settings.json index a9c260e1..d5ddea2c 100644 --- a/src/frontend/src/locales/fr/settings.json +++ b/src/frontend/src/locales/fr/settings.json @@ -1,4 +1,9 @@ { + "account": { + "currentlyLoggedAs": "Vous êtes actuellement connecté en tant que <0>{{user}}", + "heading": "Compte", + "youAreNotLoggedIn": "Vous n'êtes pas connecté." + }, "dialog": { "heading": "Paramètres" },