From afd2f9a2990f76abffceeb8b243ff12fc3d33873 Mon Sep 17 00:00:00 2001 From: Emmanuel Pelletier Date: Thu, 25 Jul 2024 15:44:54 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(frontend)=20new=20feedback=20link=20i?= =?UTF-8?q?n=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this is just a link to an external url that is, for now, hardcoded as our deploys dont have frontend env vars right now --- src/frontend/panda.config.ts | 11 ++++---- src/frontend/src/components/Feedback.tsx | 25 +++++++++++++++++ src/frontend/src/layout/Header.tsx | 34 +++++++++++++----------- src/frontend/src/locales/de/global.json | 1 + src/frontend/src/locales/en/global.json | 1 + src/frontend/src/locales/fr/global.json | 1 + src/frontend/src/primitives/Button.tsx | 16 ++++++++++- 7 files changed, 68 insertions(+), 21 deletions(-) create mode 100644 src/frontend/src/components/Feedback.tsx diff --git a/src/frontend/panda.config.ts b/src/frontend/panda.config.ts index 79f581ff..1574a509 100644 --- a/src/frontend/panda.config.ts +++ b/src/frontend/panda.config.ts @@ -201,12 +201,13 @@ const config: Config = { 'subtle-text': { value: '{colors.red.700}' }, }, success: { - DEFAULT: { value: '{colors.emerald.700}' }, - hover: { value: '{colors.emerald.800}' }, - active: { value: '{colors.emerald.900}' }, + DEFAULT: { value: '{colors.green.700}' }, + hover: { value: '{colors.green.800}' }, + active: { value: '{colors.green.900}' }, text: { value: '{colors.white}' }, - subtle: { value: '{colors.emerald.100}' }, - 'subtle-text': { value: '{colors.emerald.700}' }, + subtle: { value: '{colors.green.100}' }, + 'subtle-text': { value: '{colors.green.800}' }, + ...pandaPreset.theme.tokens.colors.green, }, warning: { DEFAULT: { value: '{colors.amber.700}' }, diff --git a/src/frontend/src/components/Feedback.tsx b/src/frontend/src/components/Feedback.tsx new file mode 100644 index 00000000..7d995e5c --- /dev/null +++ b/src/frontend/src/components/Feedback.tsx @@ -0,0 +1,25 @@ +import { Button } from '@/primitives' +import { css } from '@/styled-system/css' +import { RiExternalLinkLine } from '@remixicon/react' +import { useTranslation } from 'react-i18next' + +export const Feedback = () => { + const { t } = useTranslation() + return ( + + ) +} diff --git a/src/frontend/src/layout/Header.tsx b/src/frontend/src/layout/Header.tsx index f03e0021..fdf711cf 100644 --- a/src/frontend/src/layout/Header.tsx +++ b/src/frontend/src/layout/Header.tsx @@ -6,6 +6,7 @@ import { A, Button, Popover, PopoverList, Text } from '@/primitives' import { SettingsButton } from '@/features/settings' import { authUrl, logoutUrl, useUser } from '@/features/auth' import { useMatchesRoute } from '@/utils/useMatchesRoute' +import { Feedback } from '@/components/Feedback' export const Header = () => { const { t } = useTranslation() @@ -26,21 +27,24 @@ export const Header = () => { >
- - { - if ( - isRoom && - !window.confirm(t('leaveRoomPrompt', { ns: 'rooms' })) - ) { - event.preventDefault() - } - }} - to="/" - > - {t('app')} - - + + + { + if ( + isRoom && + !window.confirm(t('leaveRoomPrompt', { ns: 'rooms' })) + ) { + event.preventDefault() + } + }} + to="/" + > + {t('app')} + + + +