🔧(frontend) make web app manifest optional
Add configuration to conditionally include manifest article, allowing deployments to customize or disable MoreLink component.
This commit is contained in:
committed by
aleb_the_flash
parent
211e05a0cb
commit
b33df66158
@@ -30,6 +30,7 @@ export interface ApiConfig {
|
||||
available_modes?: RecordingMode[]
|
||||
expiration_days?: number
|
||||
}
|
||||
manifest_link?: string
|
||||
}
|
||||
|
||||
const fetchConfig = (): Promise<ApiConfig> => {
|
||||
|
||||
@@ -2,17 +2,16 @@ import { A, Text } from '@/primitives'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useConfig } from '@/api/useConfig'
|
||||
|
||||
const MANIFEST_LINK =
|
||||
'https://docs.numerique.gouv.fr/docs/1ef86abf-f7e0-46ce-b6c7-8be8b8af4c3d/'
|
||||
|
||||
export const MoreLink = () => {
|
||||
const { t } = useTranslation('home')
|
||||
const { data } = useConfig()
|
||||
|
||||
if (!data?.manifest_link) return
|
||||
|
||||
return (
|
||||
<Text as={'p'} variant={'sm'} style={{ padding: '1rem 0' }}>
|
||||
<A
|
||||
href={MANIFEST_LINK}
|
||||
href={data?.manifest_link}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
aria-label={t('moreLinkLabel')}
|
||||
|
||||
Reference in New Issue
Block a user