From 70dbf94f7b517f5fd2c6ed6093d6c0dff4f2b682 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Tue, 17 Dec 2024 00:05:48 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9(frontend)=20avoid=20duplicating=20?= =?UTF-8?q?Grist=20form's=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It led to an error, with two occurrences of the form's URL being desynchronized. Fix this minor issue, and refactor the constant in a constant file to be shared across the app. --- src/frontend/src/components/FeedbackBanner.tsx | 4 +--- .../livekit/components/controls/Options/OptionsMenuItems.tsx | 3 ++- src/frontend/src/utils/constants.ts | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 src/frontend/src/utils/constants.ts diff --git a/src/frontend/src/components/FeedbackBanner.tsx b/src/frontend/src/components/FeedbackBanner.tsx index caed695b..3e197258 100644 --- a/src/frontend/src/components/FeedbackBanner.tsx +++ b/src/frontend/src/components/FeedbackBanner.tsx @@ -2,9 +2,7 @@ import { css } from '@/styled-system/css' import { RiErrorWarningLine, RiExternalLinkLine } from '@remixicon/react' import { useTranslation } from 'react-i18next' import { Text, A } from '@/primitives' - -const GRIST_FORM = - 'https://grist.numerique.gouv.fr/o/docs/forms/1YrfNP1QSSy8p2gCxMFnSf/4' +import { GRIST_FORM } from '@/utils/constants' export const FeedbackBanner = () => { const { t } = useTranslation() diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Options/OptionsMenuItems.tsx b/src/frontend/src/features/rooms/livekit/components/controls/Options/OptionsMenuItems.tsx index 4a5546a4..55300f96 100644 --- a/src/frontend/src/features/rooms/livekit/components/controls/Options/OptionsMenuItems.tsx +++ b/src/frontend/src/features/rooms/livekit/components/controls/Options/OptionsMenuItems.tsx @@ -9,6 +9,7 @@ import { Separator } from '@/primitives/Separator' import { useSidePanel } from '../../../hooks/useSidePanel' import { menuRecipe } from '@/primitives/menuRecipe.ts' import { useSettingsDialog } from '../SettingsDialogContext' +import { GRIST_FORM } from '@/utils/constants' // @todo try refactoring it to use MenuList component export const OptionsMenuItems = () => { @@ -34,7 +35,7 @@ export const OptionsMenuItems = () => {
diff --git a/src/frontend/src/utils/constants.ts b/src/frontend/src/utils/constants.ts new file mode 100644 index 00000000..01b962e9 --- /dev/null +++ b/src/frontend/src/utils/constants.ts @@ -0,0 +1,2 @@ +export const GRIST_FORM = + 'https://grist.numerique.gouv.fr/o/docs/forms/1YrfNP1QSSy8p2gCxMFnSf/4' as const