diff --git a/mon-entreprise/cypress/integration/publi.codes/index.js b/mon-entreprise/cypress/integration/publi.codes/index.js
index 4c7642bcf..ba756f0c4 100644
--- a/mon-entreprise/cypress/integration/publi.codes/index.js
+++ b/mon-entreprise/cypress/integration/publi.codes/index.js
@@ -3,6 +3,7 @@ describe('Navigation', function () {
cy.visit('/')
})
it('liste des mécanismes should not crash', function () {
+ cy.contains('Documentation').click()
cy.contains('Liste des mécanismes').click()
cy.contains('barème')
})
diff --git a/mon-entreprise/source/sites/publi.codes/Documentation.tsx b/mon-entreprise/source/sites/publi.codes/Documentation.tsx
index 3e30dfffa..be640b3bb 100644
--- a/mon-entreprise/source/sites/publi.codes/Documentation.tsx
+++ b/mon-entreprise/source/sites/publi.codes/Documentation.tsx
@@ -1,32 +1,40 @@
import { MarkdownWithAnchorLinks } from 'Components/utils/markdown'
import { ScrollToTop } from 'Components/utils/Scroll'
+import { Redirect, Route, Switch } from 'react-router-dom'
+import api from '../../../../publicodes/docs/api.md'
import principes from '../../../../publicodes/docs/principes-de-base.md'
import start from '../../../../publicodes/docs/se-lancer.md'
-import api from '../../../../publicodes/docs/api.md'
-import { Redirect, Route, Switch } from 'react-router-dom'
import { Navigation } from './Header'
import Mécanismes from './Mécanismes'
const items = [
- ['se-lancer', 'Se lancer', () => ],
+ [
+ 'se-lancer',
+ 'Se lancer',
+ () => ,
+ ] as const,
[
'principes-de-base',
'Principes de base',
() => ,
- ],
- ['api', 'API', () => ],
- ['mécanismes', 'Liste des mécanismes', Mécanismes],
+ ] as const,
+ ['api', 'API', () => ] as const,
+ ['mécanismes', 'Liste des mécanismes', Mécanismes] as const,
]
export default function Langage() {
return (
-
+
[a, b])} sub="documentation" />
{items.map(([path, _, component]) => (
-
+
))}
(
+const items = [
+ ['documentation', 'Documentation'] as const,
+ ['communauté', 'Communauté'] as const,
+ ['studio', 'Bac à sable'] as const,
+]
+
+export const Header = () => (
)
@@ -20,12 +25,11 @@ const activeStyle = {
padding: '.1rem .3rem',
} as React.CSSProperties
-const items = [
- ['documentation', 'Documentation'],
- ['communauté', 'Communauté'],
- ['studio', 'Bac à sable'],
-]
-export const Navigation = ({ items, sub = false }) => {
+type NavProps = {
+ items: Array
+ sub?: string
+}
+export const Navigation = ({ items, sub }: NavProps) => {
return (