From 6ad1e27acf5f7a63121110ccb8307504dac45805 Mon Sep 17 00:00:00 2001 From: Nathan Panchout Date: Mon, 23 Dec 2024 10:31:08 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(frontend)=20enhance=20UI=20components?= =?UTF-8?q?=20and=20improve=20styling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated DropdownMenu and ButtonLogin components for better accessibility and visual consistency. - Refactored Header and Title components to utilize new theming and spacing tokens. - Enhanced LanguagePicker styles for improved user experience. - Introduced new utility functions in doc-management for better handling of ProseMirror nodes and Yjs integration. - Cleaned up unused imports and adjusted component styles for overall code maintainability. --- .../impress/src/components/DropdownMenu.tsx | 8 ++--- .../impress/src/core/auth/ButtonLogin.tsx | 15 ++------ .../src/features/header/components/Header.tsx | 10 ++++-- .../header/components/Title/Title.tsx | 35 ++++++++++--------- .../src/features/language/LanguagePicker.tsx | 12 +++++-- 5 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/frontend/apps/impress/src/components/DropdownMenu.tsx b/src/frontend/apps/impress/src/components/DropdownMenu.tsx index 2f4196b5..82e80fc6 100644 --- a/src/frontend/apps/impress/src/components/DropdownMenu.tsx +++ b/src/frontend/apps/impress/src/components/DropdownMenu.tsx @@ -50,6 +50,7 @@ export const DropdownMenu = ({
{children}
{topMessage && ( )} - + {option.label}
diff --git a/src/frontend/apps/impress/src/core/auth/ButtonLogin.tsx b/src/frontend/apps/impress/src/core/auth/ButtonLogin.tsx index f54fab32..abbdc437 100644 --- a/src/frontend/apps/impress/src/core/auth/ButtonLogin.tsx +++ b/src/frontend/apps/impress/src/core/auth/ButtonLogin.tsx @@ -1,5 +1,4 @@ import { Button } from '@openfun/cunningham-react'; -import React from 'react'; import { useTranslation } from 'react-i18next'; import { useAuthStore } from '@/core/auth'; @@ -10,24 +9,14 @@ export const ButtonLogin = () => { if (!authenticated) { return ( - ); } return ( - ); diff --git a/src/frontend/apps/impress/src/features/header/components/Header.tsx b/src/frontend/apps/impress/src/features/header/components/Header.tsx index 53ec256a..de6eb6e6 100644 --- a/src/frontend/apps/impress/src/features/header/components/Header.tsx +++ b/src/frontend/apps/impress/src/features/header/components/Header.tsx @@ -50,8 +50,14 @@ export const Header = () => { size="medium" onClick={() => togglePanel()} aria-label={t('Open the header menu')} - color="primary-text" - icon={} + color="tertiary-text" + icon={ + + } /> )} diff --git a/src/frontend/apps/impress/src/features/header/components/Title/Title.tsx b/src/frontend/apps/impress/src/features/header/components/Title/Title.tsx index ae4b9874..afc16f01 100644 --- a/src/frontend/apps/impress/src/features/header/components/Title/Title.tsx +++ b/src/frontend/apps/impress/src/features/header/components/Title/Title.tsx @@ -1,30 +1,31 @@ import { useTranslation } from 'react-i18next'; -import { Text } from '@/components/'; +import { Box, Text } from '@/components/'; +import { useCunninghamTheme } from '@/cunningham'; const Title = () => { const { t } = useTranslation(); + const theme = useCunninghamTheme(); + const spacings = theme.spacingsTokens(); + const colors = theme.colorsTokens(); return ( - <> - - BETA - + {t('Docs')} - + + BETA + + ); }; diff --git a/src/frontend/apps/impress/src/features/language/LanguagePicker.tsx b/src/frontend/apps/impress/src/features/language/LanguagePicker.tsx index 6e618874..a9a4135e 100644 --- a/src/frontend/apps/impress/src/features/language/LanguagePicker.tsx +++ b/src/frontend/apps/impress/src/features/language/LanguagePicker.tsx @@ -27,7 +27,7 @@ const SelectStyled = styled(Select)<{ $isSmall?: boolean }>` } &:hover { - box-shadow: var(--c--theme--colors--primary-100) 0 0 0 2px !important; + box-shadow: none !important; } } `; @@ -48,10 +48,16 @@ export const LanguagePicker = () => { $gap="0.7rem" $align="center" > - + translate - + {LANGUAGES_ALLOWED[lang]}