From 57ace21e80048b747de6dfc34c91dd65e95d22f8 Mon Sep 17 00:00:00 2001 From: Benjamin Arias Date: Wed, 15 Mar 2023 11:15:35 +0100 Subject: [PATCH] fix: Card --- site/source/design-system/card/Card.tsx | 21 +++++++------------ .../pages/simulateurs-et-assistants/index.tsx | 18 +++++++--------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/site/source/design-system/card/Card.tsx b/site/source/design-system/card/Card.tsx index 0f2a945bd..91385e7ab 100644 --- a/site/source/design-system/card/Card.tsx +++ b/site/source/design-system/card/Card.tsx @@ -53,12 +53,7 @@ export function Card({ delete buttonOrLinkProps.title return ( - + {icon && {icon}} {title && (compact ? ( @@ -76,7 +71,13 @@ export function Card({ {children} {ctaLabel && ( - + {ctaLabel} {linkProps.external && } @@ -133,7 +134,6 @@ export const CardContainer = styled.div<{ width: 100%; height: 100%; text-decoration: none; - cursor: ${({ $inert }) => ($inert ? 'auto' : 'pointer')}; flex-direction: column; align-items: center; border: solid 1px ${({ theme }) => theme.colors.extended.grey[300]}; @@ -148,11 +148,6 @@ export const CardContainer = styled.div<{ box-shadow: ${({ theme, $inert }) => !$inert && (theme.darkMode ? theme.elevationsDarkMode[3] : theme.elevations[3])}; - background-color: ${({ theme, $inert }) => - !$inert && - (theme.darkMode - ? theme.colors.extended.dark[500] - : theme.colors.bases.primary[100])}; } padding: ${({ theme: { spacings }, $compact = false }) => $compact diff --git a/site/source/pages/simulateurs-et-assistants/index.tsx b/site/source/pages/simulateurs-et-assistants/index.tsx index 12f708e2e..a6fa04101 100644 --- a/site/source/pages/simulateurs-et-assistants/index.tsx +++ b/site/source/pages/simulateurs-et-assistants/index.tsx @@ -232,6 +232,11 @@ export function SimulateurCard({ const isIframe = useIsEmbedded() const { t } = useTranslation() + const ctaLabel = + pathId.startsWith('assistants') || pathId.startsWith('gérer') + ? t('pages.simulateurs.home.cta.assistant', "Lancer l'assistant") + : t('pages.simulateurs.home.cta.simulateur', 'Lancer le simulateur') + return ( <> {small ? ( @@ -270,17 +275,8 @@ export function SimulateurCard({ } icon={} - ctaLabel={ - pathId.startsWith('assistants') || pathId.startsWith('gérer') - ? t( - 'pages.simulateurs.home.cta.assistant', - "Lancer l'assistant" - ) - : t( - 'pages.simulateurs.home.cta.simulateur', - 'Lancer le simulateur' - ) - } + ctaLabel={ctaLabel} + aria-label={`${shortName}, ${ctaLabel}`} to={{ pathname: (isIframe && `/iframes/${encodeURI(iframePath ?? '')}`) || path,