From 644566c8040ce3d9b90eb8c1997149f7a68ffecd Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Wed, 6 Feb 2019 19:09:58 +0100 Subject: [PATCH] :alien: ajoute le bouton de changement de langue --- netlify.toml | 4 ++++ source/components/utils/withSitePaths.js | 9 ++++++++- .../sites/mycompanyinfrance.fr/layout/Footer/Footer.js | 9 ++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/netlify.toml b/netlify.toml index 1249f2c79..8dd761ffd 100644 --- a/netlify.toml +++ b/netlify.toml @@ -133,3 +133,7 @@ status = 200 [context.production.environment] EN_SITE = "https://mycompanyinfrance.fr${path}" FR_SITE = "https://mon-entreprise.fr${path}" + +[context.demo] + EN_SITE = "https://demo.mon-entreprise.fr${path}?s=m" + FR_SITE = "https://demo.mon-entreprise.fr${path}" diff --git a/source/components/utils/withSitePaths.js b/source/components/utils/withSitePaths.js index dc4fbb538..d60a1bd90 100644 --- a/source/components/utils/withSitePaths.js +++ b/source/components/utils/withSitePaths.js @@ -1,6 +1,6 @@ /* @flow */ - import React, { Component, createContext } from 'react' +import i18n from '../../i18n' const SitePathsContext: React$Context = createContext({}) @@ -12,6 +12,13 @@ export default function withSitePaths( $Diff > { displayName = `withSitePaths(${WrappedComponent.displayName || ''})` + constructor(props) { + super(props) + i18n.on('languageChanged', () => { + console.log('zop') + this.forceUpdate() + }) + } render() { return ( diff --git a/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js b/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js index 3870ea3e9..c366ce922 100644 --- a/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js +++ b/source/sites/mycompanyinfrance.fr/layout/Footer/Footer.js @@ -6,6 +6,7 @@ import withColours from 'Components/utils/withColours' import urssafSvg from 'Images/urssaf.svg' import { compose } from 'ramda' import React from 'react' +import emoji from 'react-easy-emoji' import Helmet from 'react-helmet' import i18n from '../../../../i18n' import { feedbackBlacklist } from '../../config' @@ -62,7 +63,7 @@ const Footer = ({ colours: { colour } }) => { {' • '} - {/* {!!hrefLink.length && ' • '} + {!!hrefLink.length && ' • '} {hrefLink.map(({ hrefLang, href }) => ( { hrefLang )} - ))} */} + ))}

) } -export default compose( - withColours, -)(Footer) +export default compose(withColours)(Footer)