👽 ajoute le bouton de changement de langue

demo-contrôles
Johan Girod 2019-02-06 19:09:58 +01:00
parent 3160c2348d
commit 644566c804
3 changed files with 16 additions and 6 deletions

View File

@ -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}"

View File

@ -1,6 +1,6 @@
/* @flow */
import React, { Component, createContext } from 'react'
import i18n from '../../i18n'
const SitePathsContext: React$Context<SitePaths> = createContext({})
@ -12,6 +12,13 @@ export default function withSitePaths<Props: { sitePaths: SitePaths }>(
$Diff<Props, { sitePaths: SitePaths }>
> {
displayName = `withSitePaths(${WrappedComponent.displayName || ''})`
constructor(props) {
super(props)
i18n.on('languageChanged', () => {
console.log('zop')
this.forceUpdate()
})
}
render() {
return (
<SitePathsContext.Consumer>

View File

@ -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 } }) => {
<LegalNotice />
{' • '}
<Privacy />
{/* {!!hrefLink.length && ' '}
{!!hrefLink.length && ' • '}
{hrefLink.map(({ hrefLang, href }) => (
<a
href={href}
@ -76,13 +77,11 @@ const Footer = ({ colours: { colour } }) => {
hrefLang
)}
</a>
))} */}
))}
</p>
</div>
</footer>
</div>
)
}
export default compose(
withColours,
)(Footer)
export default compose(withColours)(Footer)