Skip to content

Commit

Permalink
🩹(frontend) avoid duplicating Grist form's URL
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lebaudantoine committed Dec 16, 2024
1 parent 0ad37ee commit 70dbf94
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/frontend/src/components/FeedbackBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand All @@ -34,7 +35,7 @@ export const OptionsMenuItems = () => {
<Separator />
<Section>
<MenuItem
href="https://grist.incubateur.net/o/docs/forms/1YrfNP1QSSy8p2gCxMFnSf/4"
href={GRIST_FORM}
target="_blank"
className={menuRecipe({ icon: true }).item}
>
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const GRIST_FORM =
'https://grist.numerique.gouv.fr/o/docs/forms/1YrfNP1QSSy8p2gCxMFnSf/4' as const

0 comments on commit 70dbf94

Please sign in to comment.