Met à jour la description de site sur les réseaux sociaux
- supprime la double meta description - met à jour et traduit les meta og: - simplifie template.htmlpull/2583/head
parent
e8395ad898
commit
2553fa0b6c
|
@ -42,60 +42,11 @@ export default function Provider({
|
|||
}: ProviderProps): JSX.Element {
|
||||
useIframeResizer()
|
||||
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<DarkModeProvider>
|
||||
<DesignSystemThemeProvider>
|
||||
<GlobalStyle />
|
||||
<ErrorBoundary
|
||||
showDialog
|
||||
fallback={(errorData) => (
|
||||
<main style={{ height: '100vh' }}>
|
||||
<Container>
|
||||
<Link href="/" aria-label={t("Retourner à la page d'accueil")}>
|
||||
<img
|
||||
src={logo}
|
||||
alt="Logo mon-entreprise"
|
||||
style={{
|
||||
maxWidth: '200px',
|
||||
width: '100%',
|
||||
marginTop: '1rem',
|
||||
}}
|
||||
></img>
|
||||
</Link>
|
||||
<H1>Une erreur est survenue</H1>
|
||||
<Intro>
|
||||
L'équipe technique mon-entreprise a été automatiquement
|
||||
prévenue.
|
||||
</Intro>
|
||||
<Body>
|
||||
Vous pouvez également nous contacter directement à l'adresse{' '}
|
||||
<Link
|
||||
href="mailto:contact@mon-entreprise.beta.gouv.fr"
|
||||
aria-label={t(
|
||||
'Envoyer un courriel à contact@mon-entreprise.beta.gouv.fr, nouvelle fenêtre'
|
||||
)}
|
||||
>
|
||||
contact@mon-entreprise.beta.gouv.fr
|
||||
</Link>{' '}
|
||||
si vous souhaitez partager une remarque. Veuillez nous excuser
|
||||
pour la gêne occasionnée.
|
||||
</Body>
|
||||
<Grid container>
|
||||
<Grid item xs={12} lg={6}>
|
||||
<Message type="info">
|
||||
<H4>Cause de l'erreur :</H4>
|
||||
<Body>
|
||||
{errorData.error.name} : {errorData.error.message}
|
||||
</Body>
|
||||
</Message>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
</main>
|
||||
)}
|
||||
>
|
||||
<ErrorBoundary showDialog fallback={ErrorFallback}>
|
||||
{!import.meta.env.SSR &&
|
||||
import.meta.env.MODE === 'production' &&
|
||||
'serviceWorker' in navigator &&
|
||||
|
@ -121,6 +72,60 @@ export default function Provider({
|
|||
)
|
||||
}
|
||||
|
||||
function ErrorFallback(props: {
|
||||
error: Error
|
||||
componentStack: string | null
|
||||
eventId: string | null
|
||||
resetError(): void
|
||||
}) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<main style={{ height: '100vh' }}>
|
||||
<Container>
|
||||
<Link href="/" aria-label={t("Retourner à la page d'accueil")}>
|
||||
<img
|
||||
src={logo}
|
||||
alt="Logo mon-entreprise"
|
||||
style={{
|
||||
maxWidth: '200px',
|
||||
width: '100%',
|
||||
marginTop: '1rem',
|
||||
}}
|
||||
></img>
|
||||
</Link>
|
||||
<H1>Une erreur est survenue</H1>
|
||||
<Intro>
|
||||
L'équipe technique mon-entreprise a été automatiquement prévenue.
|
||||
</Intro>
|
||||
<Body>
|
||||
Vous pouvez également nous contacter directement à l'adresse{' '}
|
||||
<Link
|
||||
href="mailto:contact@mon-entreprise.beta.gouv.fr"
|
||||
aria-label={t(
|
||||
'Envoyer un courriel à contact@mon-entreprise.beta.gouv.fr, nouvelle fenêtre'
|
||||
)}
|
||||
>
|
||||
contact@mon-entreprise.beta.gouv.fr
|
||||
</Link>{' '}
|
||||
si vous souhaitez partager une remarque. Veuillez nous excuser pour la
|
||||
gêne occasionnée.
|
||||
</Body>
|
||||
<Grid container>
|
||||
<Grid item xs={12} lg={6}>
|
||||
<Message type="info">
|
||||
<H4>Cause de l'erreur :</H4>
|
||||
<Body>
|
||||
{props.error.name} : {props.error.message}
|
||||
</Body>
|
||||
</Message>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
function BrowserRouterProvider({
|
||||
children,
|
||||
basename,
|
||||
|
|
|
@ -7,13 +7,44 @@ type Props = {
|
|||
}
|
||||
|
||||
const DefaultHelmet = ({ children }: Props) => {
|
||||
const { t } = useTranslation()
|
||||
const { t, i18n } = useTranslation()
|
||||
|
||||
return (
|
||||
<Helmet
|
||||
defaultTitle={t('site.defaultTitle', 'Mon-entreprise')}
|
||||
titleTemplate={t('site.titleTemplate', '%s - Mon-entreprise')}
|
||||
>
|
||||
<meta property="og:type" content="website" />
|
||||
<meta
|
||||
name="description"
|
||||
content={t(
|
||||
'site.meta.description',
|
||||
'Des simulateurs et assistants pour développer votre activité'
|
||||
)}
|
||||
/>
|
||||
<meta
|
||||
property="og:title"
|
||||
content={t(
|
||||
'site.meta.og:title',
|
||||
'mon-entreprise.urssaf.fr : Simulateurs et assistants pour développer votre activité'
|
||||
)}
|
||||
/>
|
||||
<meta
|
||||
property="og:description"
|
||||
content={t(
|
||||
'site.meta.og:description',
|
||||
"Une collection d'assistants et de simulateurs crées par l'Urssaf pour vous accompagner dans le développement de votre activité"
|
||||
)}
|
||||
/>
|
||||
<meta
|
||||
property="og:image"
|
||||
content={
|
||||
i18n.language === 'fr'
|
||||
? '/assets/images/logo-monentreprise.svg'
|
||||
: '/assets/images/logo-mycompany-share.svg'
|
||||
}
|
||||
/>
|
||||
|
||||
{children}
|
||||
</Helmet>
|
||||
)
|
||||
|
|
|
@ -43,36 +43,29 @@
|
|||
|
||||
<meta name="theme-color" content="#2975d1" />
|
||||
|
||||
<!--app-helmet-tags:start-->
|
||||
<meta name="description" content="{{ description }}" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="{{ title }}" />
|
||||
<meta property="og:description" content="{{ description }}" />
|
||||
<meta property="og:image" content="{{ shareImage }}" />
|
||||
|
||||
<!--app-helmet-tags:end-->
|
||||
|
||||
<style>
|
||||
html[data-useragent*='MSIE'] #outdated-browser,
|
||||
html[data-useragent*='Safari'][data-useragent*='Version/8']
|
||||
html[data-useragent*=‘MSIE’] #outdated-browser,
|
||||
html[data-useragent*=‘Safari’][data-useragent*=‘Version/8’]
|
||||
#outdated-browser,
|
||||
html[data-useragent*='Safari'][data-useragent*='Version/7']
|
||||
html[data-useragent*=‘Safari’][data-useragent*=‘Version/7’]
|
||||
#outdated-browser,
|
||||
html[data-useragent*='Trident'] #outdated-browser {
|
||||
html[data-useragent*=‘Trident’] #outdated-browser {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
html[data-useragent*='MSIE'] #loading,
|
||||
html[data-useragent*='Safari'][data-useragent*='Version/8'] #loading,
|
||||
html[data-useragent*='Safari'][data-useragent*='Version/7'] #loading,
|
||||
html[data-useragent*='Trident'] #loading {
|
||||
html[data-useragent*=‘MSIE’] #loading,
|
||||
html[data-useragent*=‘Safari’][data-useragent*=‘Version/8’] #loading,
|
||||
html[data-useragent*=‘Safari’][data-useragent*=‘Version/7’] #loading,
|
||||
html[data-useragent*=‘Trident’] #loading {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
html[data-useragent*='MSIE'] #js,
|
||||
html[data-useragent*='Safari'][data-useragent*='Version/8'] #js,
|
||||
html[data-useragent*='Safari'][data-useragent*='Version/7'] #js,
|
||||
html[data-useragent*='Trident'] #js {
|
||||
html[data-useragent*=‘MSIE’] #js,
|
||||
html[data-useragent*=‘Safari’][data-useragent*=‘Version/8’] #js,
|
||||
html[data-useragent*=‘Safari’][data-useragent*=‘Version/7’] #js,
|
||||
html[data-useragent*=‘Trident’] #js {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
|
@ -166,8 +159,8 @@
|
|||
<!--app-html:start-->
|
||||
<div id="loading">
|
||||
<img
|
||||
src="{{ shareImage }}"
|
||||
alt="{{ shareImageAlt }}"
|
||||
src="{{ logo }}"
|
||||
alt="{{ logoAlt }}"
|
||||
style="
|
||||
width: 300px;
|
||||
margin: auto;
|
||||
|
@ -186,16 +179,16 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
const isIframe = document.location.pathname.startsWith('/iframes/')
|
||||
const isIframe = document.location.pathname.startsWith(’/iframes/’)
|
||||
|
||||
function getItem(key) {
|
||||
try {
|
||||
return window.localStorage.getItem(key)
|
||||
} catch (error) {
|
||||
if (error instanceof Error && error.name === 'SecurityError') {
|
||||
if (error instanceof Error && error.name === ‘SecurityError’) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
'[localStorage] Unable to set item due to security settings'
|
||||
'[localStorage] Unable to set item due to security settings’
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -203,17 +196,17 @@
|
|||
}
|
||||
}
|
||||
|
||||
const darkMode = !isIframe && getItem('darkMode') === 'true'
|
||||
const darkMode = !isIframe && getItem(‘darkMode’) === ‘true’
|
||||
|
||||
if (darkMode) {
|
||||
document.body.style.backgroundColor = '#0f172a'
|
||||
document.body.style.backgroundColor = '#0f172a’
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- USER AGENT DATA ATTRIBUTE -->
|
||||
<script>
|
||||
var b = document.documentElement
|
||||
b.setAttribute('data-useragent', navigator.userAgent)
|
||||
b.setAttribute(‘data-useragent’, navigator.userAgent)
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
@ -231,19 +224,19 @@
|
|||
try {
|
||||
const rawColor = new URLSearchParams(
|
||||
document.location.search.substring(1)
|
||||
).get('couleur')
|
||||
).get(‘couleur’)
|
||||
const iframeColor = rawColor && parseColor(rawColor)
|
||||
;[
|
||||
document.documentElement,
|
||||
...document.querySelectorAll('[data-js-color-element]'),
|
||||
…document.querySelectorAll(’[data-js-color-element]’),
|
||||
].forEach((element) => {
|
||||
element.style.setProperty(
|
||||
'--COLOR_HUE',
|
||||
iframeColor ? iframeColor[0] : '220deg'
|
||||
'--COLOR_HUE’,
|
||||
iframeColor ? iframeColor[0] : ‘220deg’
|
||||
)
|
||||
element.style.setProperty(
|
||||
'--COLOR_SATURATION',
|
||||
iframeColor ? iframeColor[1] + '%' : '100%'
|
||||
'--COLOR_SATURATION’,
|
||||
iframeColor ? iframeColor[1] + '%’ : ‘100%’
|
||||
)
|
||||
})
|
||||
} catch (e) {
|
||||
|
@ -278,7 +271,7 @@
|
|||
alt="Logo service mon-entreprise urssaf"
|
||||
style="width: 200px; margin-bottom: 2rem"
|
||||
/>
|
||||
<h1>Votre navigateur n'est plus supporté.</h1>
|
||||
<h1>Votre navigateur n’est plus supporté.</h1>
|
||||
<h2>
|
||||
Nous vous invitons à réessayer avec un autre, ou depuis un mobile
|
||||
récent.
|
||||
|
|
|
@ -72,22 +72,14 @@ export default defineConfig(({ command, mode }) => ({
|
|||
'mon-entreprise': {
|
||||
lang: 'fr',
|
||||
entry: '/source/entries/entry-fr.tsx',
|
||||
title:
|
||||
"mon-entreprise.urssaf.fr : L'assistant officiel du créateur d'entreprise",
|
||||
description:
|
||||
'Du statut juridique à la première embauche, en passant par la simulation des cotisations, vous trouverez ici toutes les ressources pour démarrer votre activité.',
|
||||
shareImage: '/source/assets/images/logo-monentreprise.svg',
|
||||
shareImageAlt: 'Logo mon-entreprise, site Urssaf',
|
||||
logo: '/source/assets/images/logo-monentreprise.svg',
|
||||
logoAlt: 'Logo mon-entreprise, site Urssaf',
|
||||
},
|
||||
infrance: {
|
||||
lang: 'en',
|
||||
entry: '/source/entries/entry-en.tsx',
|
||||
title:
|
||||
'My company in France: A step-by-step guide to start a business in France',
|
||||
description:
|
||||
'Find the type of company that suits you and follow the steps to register your company. Discover the French social security system by simulating your hiring costs. Discover the procedures to hire in France and learn the basics of French labour law.',
|
||||
shareImage: '/logo-mycompany-share.png',
|
||||
shareImageAlt: 'Logo My company in France by Urssaf',
|
||||
logo: '/logo-mycompany-share.png',
|
||||
logoAlt: 'Logo My company in France by Urssaf',
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
|
Loading…
Reference in New Issue