diff --git a/mon-entreprise/source/components/conversation/Aide.tsx b/mon-entreprise/source/components/conversation/Aide.tsx index ee67c7d1b..b5af26106 100644 --- a/mon-entreprise/source/components/conversation/Aide.tsx +++ b/mon-entreprise/source/components/conversation/Aide.tsx @@ -1,13 +1,13 @@ import { explainVariable } from 'Actions/actions' import Overlay from 'Components/Overlay' +import { EngineContext } from 'Components/utils/EngineContext' import { Markdown } from 'Components/utils/markdown' import { useContext } from 'react' +import { Trans } from 'react-i18next' import { useDispatch, useSelector } from 'react-redux' import { RootState } from 'Reducers/rootReducer' -import { References } from 'publicodes-react' -import { Trans } from 'react-i18next' +import { References } from '../../pages/Documentation' import './Aide.css' -import { EngineContext } from 'Components/utils/EngineContext' export default function Aide() { const explained = useSelector((state: RootState) => state.explainedVariable) @@ -36,7 +36,7 @@ export default function Aide() {

En savoir plus

- + )} diff --git a/mon-entreprise/source/components/conversation/Question.tsx b/mon-entreprise/source/components/conversation/Question.tsx index 14363db2f..d0b723438 100644 --- a/mon-entreprise/source/components/conversation/Question.tsx +++ b/mon-entreprise/source/components/conversation/Question.tsx @@ -4,7 +4,6 @@ import Emoji from 'Components/utils/Emoji' import { Markdown } from 'Components/utils/markdown' import { DottedName } from 'modele-social' import { EvaluatedNode, Rule, RuleNode, serializeEvaluation } from 'publicodes' -import { References } from 'publicodes-react' import { createContext, useCallback, @@ -13,6 +12,7 @@ import { useState, } from 'react' import { Trans } from 'react-i18next' +import { References } from '../../pages/Documentation' import { Explicable } from './Explicable' import { binaryQuestion, InputProps } from './RuleInput' @@ -211,7 +211,7 @@ export const RadioLabel = (props: RadioLabelProps) => (

En savoir plus

- + )} diff --git a/mon-entreprise/source/pages/Documentation.tsx b/mon-entreprise/source/pages/Documentation.tsx index 3c634772a..88ad32152 100644 --- a/mon-entreprise/source/pages/Documentation.tsx +++ b/mon-entreprise/source/pages/Documentation.tsx @@ -2,20 +2,27 @@ import SearchRules from 'Components/search/SearchRules' import { FromBottom } from 'Components/ui/animate' import { ThemeColorsProvider } from 'Components/utils/colors' import { useEngine } from 'Components/utils/EngineContext' +import Meta from 'Components/utils/Meta' import { ScrollToTop } from 'Components/utils/Scroll' import { SitePathsContext } from 'Components/utils/SitePathsContext' -import { RulePage, getDocumentationSiteMap } from 'publicodes-react' +import rules, { DottedName } from 'modele-social' +import { getDocumentationSiteMap, RulePage } from 'publicodes-react' import { useCallback, useContext, useMemo } from 'react' +import { Helmet } from 'react-helmet-async' import { Trans, useTranslation } from 'react-i18next' import { useSelector } from 'react-redux' -import { Redirect, useHistory, useLocation, Link } from 'react-router-dom' +import { + Link, + Redirect, + Route, + useHistory, + useLocation, +} from 'react-router-dom' import { RootState } from 'Reducers/rootReducer' +import styled from 'styled-components' import { TrackPage } from '../ATInternetTracking' -import rules, { DottedName } from 'modele-social' import RuleLink from '../components/RuleLink' -import Meta from 'Components/utils/Meta' -import { Route } from 'react-router-dom' -import { Helmet } from 'react-helmet-async' +import { capitalise0 } from '../utils' export default function MonEntrepriseRulePage() { const currentSimulation = useSelector( @@ -70,10 +77,10 @@ export default function MonEntrepriseRulePage() { rulePath={match.params.name} engine={engine} documentationPath={documentationPath} - referenceImages={referencesImages} renderers={{ Head: Helmet, Link, + References, }} /> )} @@ -88,7 +95,7 @@ function BackToSimulation() { const history = useHistory() const handleClick = useCallback(() => { url && history.push(url) - }, []) + }, [history, url]) return (