diff --git a/src/frontend/src/components/LoginButton.tsx b/src/frontend/src/components/LoginButton.tsx index 70876d55..c597cc85 100644 --- a/src/frontend/src/components/LoginButton.tsx +++ b/src/frontend/src/components/LoginButton.tsx @@ -1,9 +1,21 @@ import { LinkButton } from '@/primitives' import { authUrl } from '@/features/auth' import { useTranslation } from 'react-i18next' +import { useConfig } from '@/api/useConfig' +import { ProConnectButton } from './ProConnectButton' -export const LoginButton = () => { +type LoginButtonProps = { + proConnectHint?: boolean // Hide hint in layouts where space doesn't allow it. +} + +export const LoginButton = ({ proConnectHint = true }: LoginButtonProps) => { const { t } = useTranslation('global', { keyPrefix: 'login' }) + const { data } = useConfig() + + if (data?.use_proconnect_button) { + return + } + return ( {t('buttonLabel')} diff --git a/src/frontend/src/components/ProConnectButton.tsx b/src/frontend/src/components/ProConnectButton.tsx index 6a0d83fe..f16a069c 100644 --- a/src/frontend/src/components/ProConnectButton.tsx +++ b/src/frontend/src/components/ProConnectButton.tsx @@ -1,9 +1,9 @@ -import { Link } from 'react-aria-components' +import { Link as RALink } from 'react-aria-components' import { authUrl } from '@/features/auth' import { cva } from '@/styled-system/css' import { useTranslation } from 'react-i18next' import { VStack } from '@/styled-system/jsx' -import { Text } from '@/primitives' +import { Link } from '@/primitives' // Styles per their documentation https://github.com/numerique-gouv/agentconnect-documentation/blob/main/doc_fs/bouton_proconnect.md const proConnectButtonRecipe = cva({ @@ -32,23 +32,22 @@ export const ProConnectButton = ({ hint = true }: ProConnectButtonProps) => { const { t } = useTranslation('global', { keyPrefix: 'login' }) return ( - {hint && ( - - - {t('link')} - - + + {t('proconnectLink')} + )} ) diff --git a/src/frontend/src/features/home/routes/Home.tsx b/src/frontend/src/features/home/routes/Home.tsx index 64f5bfee..861310bf 100644 --- a/src/frontend/src/features/home/routes/Home.tsx +++ b/src/frontend/src/features/home/routes/Home.tsx @@ -7,7 +7,6 @@ import { Screen } from '@/layout/Screen' import { generateRoomId } from '@/features/rooms' import { useUser, UserAware } from '@/features/auth' import { JoinMeetingDialog } from '../components/JoinMeetingDialog' -import { ProConnectButton } from '@/components/ProConnectButton' import { useCreateRoom } from '@/features/rooms' import { RiAddLine, RiLink } from '@remixicon/react' import { LaterMeetingDialog } from '@/features/home/components/LaterMeetingDialog' @@ -214,10 +213,8 @@ export const Home = () => { - ) : data?.use_proconnect_button ? ( - ) : ( - + )} @@ -29,7 +29,7 @@ export const SettingsDialog = (props: SettingsDialogProps) => { ) : ( <> {t('account.youAreNotLoggedIn')} - + > )} {t('language.heading')} diff --git a/src/frontend/src/features/settings/components/tabs/AccountTab.tsx b/src/frontend/src/features/settings/components/tabs/AccountTab.tsx index 73e8d6fd..14bc7b34 100644 --- a/src/frontend/src/features/settings/components/tabs/AccountTab.tsx +++ b/src/frontend/src/features/settings/components/tabs/AccountTab.tsx @@ -6,7 +6,7 @@ import { css } from '@/styled-system/css' import { TabPanel, TabPanelProps } from '@/primitives/Tabs' import { HStack } from '@/styled-system/jsx' import { useState } from 'react' -import { ProConnectButton } from '@/components/ProConnectButton' +import { LoginButton } from '@/components/LoginButton' import { usePersistentUserChoices } from '@/features/rooms/livekit/hooks/usePersistentUserChoices' export type AccountTabProps = Pick & @@ -57,7 +57,7 @@ export const AccountTab = ({ id, onOpenChange }: AccountTabProps) => { ) : ( <> {t('account.youAreNotLoggedIn')} - + > )} { !isAccessibility && !isTermsOfService && ( <> - + > )} diff --git a/src/frontend/src/locales/de/global.json b/src/frontend/src/locales/de/global.json index 3630db55..b9aacff6 100644 --- a/src/frontend/src/locales/de/global.json +++ b/src/frontend/src/locales/de/global.json @@ -16,9 +16,10 @@ "loading": "Ladevorgang…", "loggedInUserTooltip": "Angemeldet als…", "login": { - "buttonLabel": "Mit ProConnect anmelden", - "linkLabel": "Was ist ProConnect? – neues Fenster", - "link": "Was ist ProConnect?" + "buttonLabel": "Anmelden", + "proconnectButtonLabel": "Mit ProConnect anmelden", + "proconnectLinkLabel": "Was ist ProConnect? – neues Fenster", + "proconnectLink": "Was ist ProConnect?" }, "logout": "Abmelden", "notFound": { diff --git a/src/frontend/src/locales/en/global.json b/src/frontend/src/locales/en/global.json index 96c0d60b..c59e50f8 100644 --- a/src/frontend/src/locales/en/global.json +++ b/src/frontend/src/locales/en/global.json @@ -16,10 +16,10 @@ "loading": "Loading…", "loggedInUserTooltip": "Logged in as…", "login": { - "proconnectButtonLabel": "Login with ProConnect", "buttonLabel": "Login", - "linkLabel": "What is ProConnect? - new tab", - "link": "What is ProConnect?" + "proconnectButtonLabel": "Login with ProConnect", + "proconnectLinkLabel": "What is ProConnect? - new tab", + "proconnectLink": "What is ProConnect?" }, "logout": "Logout", "notFound": { diff --git a/src/frontend/src/locales/fr/global.json b/src/frontend/src/locales/fr/global.json index 13c97c55..eb1b8a61 100644 --- a/src/frontend/src/locales/fr/global.json +++ b/src/frontend/src/locales/fr/global.json @@ -16,9 +16,10 @@ "loading": "Chargement…", "loggedInUserTooltip": "Connecté en tant que…", "login": { - "buttonLabel": "S'identifier avec ProConnect", - "linkLabel": "Qu'est-ce que ProConnect ? - nouvelle fenêtre", - "link": "Qu'est-ce que ProConnect ?" + "buttonLabel": "Se connecter", + "proconnectButtonLabel": "S'identifier avec ProConnect", + "proconnectLinkLabel": "Qu'est-ce que ProConnect ? - nouvelle fenêtre", + "proconnectLink": "Qu'est-ce que ProConnect ?" }, "logout": "Se déconnecter", "notFound": { diff --git a/src/frontend/src/locales/nl/global.json b/src/frontend/src/locales/nl/global.json index add9413f..3565e325 100644 --- a/src/frontend/src/locales/nl/global.json +++ b/src/frontend/src/locales/nl/global.json @@ -16,9 +16,10 @@ "loading": "Laden ...", "loggedInUserTooltip": "Ingelogd als ...", "login": { - "buttonLabel": "Log in met Proconnect", - "linkLabel": "Wat is ProConnect? ", - "link": "Wat is ProConnect?" + "buttonLabel": "Log in", + "proconnectButtonLabel": "Log in met Proconnect", + "proconnectLinkLabel": "Wat is ProConnect?", + "proconnectLink": "Wat is ProConnect?" }, "logout": "Uitloggen", "notFound": { diff --git a/src/frontend/src/primitives/A.tsx b/src/frontend/src/primitives/A.tsx index c5de211c..8bda7534 100644 --- a/src/frontend/src/primitives/A.tsx +++ b/src/frontend/src/primitives/A.tsx @@ -55,6 +55,9 @@ const link = cva({ primary: { color: 'blue', }, + note: { + color: 'default.subtle-text', + }, }, }, })
{t('account.youAreNotLoggedIn')}