2020-12-16 16:41:53 +01:00
|
|
|
import { MarkdownWithAnchorLinks } from '../components/markdown'
|
|
|
|
import { ScrollToTop } from '../components/Scroll'
|
2020-12-15 11:24:31 +01:00
|
|
|
import { Redirect, Route, Switch } from 'react-router-dom'
|
2020-12-16 16:41:53 +01:00
|
|
|
import api from '../../docs/api.md'
|
|
|
|
import principes from '../../docs/principes-de-base.md'
|
|
|
|
import start from '../../docs/se-lancer.md'
|
|
|
|
import { Navigation } from '../components/Header'
|
2020-12-15 10:36:09 +01:00
|
|
|
import Mécanismes from './Mécanismes'
|
|
|
|
|
|
|
|
const items = [
|
2020-12-15 11:24:31 +01:00
|
|
|
[
|
|
|
|
'se-lancer',
|
|
|
|
'Se lancer',
|
|
|
|
() => <MarkdownWithAnchorLinks source={start} />,
|
|
|
|
] as const,
|
2020-12-15 10:36:09 +01:00
|
|
|
[
|
|
|
|
'principes-de-base',
|
|
|
|
'Principes de base',
|
2020-12-15 11:14:35 +01:00
|
|
|
() => <MarkdownWithAnchorLinks source={principes} />,
|
2020-12-15 11:24:31 +01:00
|
|
|
] as const,
|
|
|
|
['api', 'API', () => <MarkdownWithAnchorLinks source={api} />] as const,
|
|
|
|
['mécanismes', 'Liste des mécanismes', Mécanismes] as const,
|
2020-12-15 10:36:09 +01:00
|
|
|
]
|
2020-12-07 16:50:55 +00:00
|
|
|
|
2020-12-07 17:25:45 +00:00
|
|
|
export default function Langage() {
|
2020-12-07 16:50:55 +00:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<ScrollToTop />
|
2020-12-15 11:24:31 +01:00
|
|
|
<Navigation items={items.map(([a, b]) => [a, b])} sub="documentation" />
|
2020-12-07 16:50:55 +00:00
|
|
|
<main>
|
2020-12-07 17:25:45 +00:00
|
|
|
<Switch>
|
2020-12-15 10:36:09 +01:00
|
|
|
{items.map(([path, _, component]) => (
|
2020-12-15 11:24:31 +01:00
|
|
|
<Route
|
|
|
|
path={'/documentation/' + path}
|
|
|
|
key={path}
|
|
|
|
component={component}
|
|
|
|
/>
|
2020-12-15 10:36:09 +01:00
|
|
|
))}
|
2020-12-15 11:14:35 +01:00
|
|
|
<Redirect
|
|
|
|
exact
|
|
|
|
from="/documentation"
|
|
|
|
to={'/documentation/' + items[0][0]}
|
|
|
|
/>
|
2020-12-07 17:25:45 +00:00
|
|
|
</Switch>
|
2020-12-07 16:50:55 +00:00
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|