From 58a6c7f3e49bab08f3716a404082646f9de0d6a9 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Thu, 21 Jun 2018 11:52:00 +0200 Subject: [PATCH] premier commit infrance.org --- source/containers/Layout.js | 71 ++++++++++++++--------------------- source/entry.js | 16 ++++++-- source/inFranceApp/Landing.js | 9 +++++ source/inFranceApp/index.js | 19 ++++++++++ 4 files changed, 70 insertions(+), 45 deletions(-) create mode 100644 source/inFranceApp/Landing.js create mode 100644 source/inFranceApp/index.js diff --git a/source/containers/Layout.js b/source/containers/Layout.js index 41cd0a98a..4079e28c4 100644 --- a/source/containers/Layout.js +++ b/source/containers/Layout.js @@ -1,55 +1,42 @@ -import { I18nextProvider } from 'react-i18next' -import i18next from 'i18next' - +import Contact from 'Components/Contact' +import Mecanisms from 'Components/Mecanisms' +import About from 'Components/pages/About' +import Contribution from 'Components/pages/Contribution' +import { Header } from 'Components/pages/Header' +import Home from 'Components/pages/Home' +import Integration from 'Components/pages/Integration' +import RulesList from 'Components/pages/RulesList' +import Route404 from 'Components/Route404' +import RulePage from 'Components/RulePage' import React, { Component } from 'react' +import { Redirect, Route, Switch } from 'react-router-dom' +import withTracker from '../components/withTracker' import './Layout.css' import './reset.css' -import { Route, Router, Switch, Redirect } from 'react-router-dom' - -import Home from 'Components/pages/Home' -import RulePage from 'Components/RulePage' -import Route404 from 'Components/Route404' -import Contact from 'Components/Contact' -import RulesList from 'Components/pages/RulesList' -import Mecanisms from 'Components/Mecanisms' -import Contribution from 'Components/pages/Contribution' -import Integration from 'Components/pages/Integration' -import About from 'Components/pages/About' -import createHistory from 'history/createBrowserHistory' -import { Header } from 'Components/pages/Header' -import withTracker from '../components/withTracker' - class Layout extends Component { - history = createHistory() componentDidMount() { this.props.tracker.push(['trackPageView']) } render() { - let { tracker } = this.props - // track the initial pageview return ( - - - <> -
- - - - - - - - - - - - - - - - - + <> +
+ + + + + + + + + + + + + + + ) } } diff --git a/source/entry.js b/source/entry.js index e262d1fde..fe6268e1f 100644 --- a/source/entry.js +++ b/source/entry.js @@ -1,13 +1,18 @@ /* global process: false */ import ReactPiwik from 'Components/Tracker' +import createHistory from 'history/createBrowserHistory' +import i18next from 'i18next' import React from 'react' import { render } from 'react-dom' import { AppContainer } from 'react-hot-loader' +import { I18nextProvider } from 'react-i18next' import { Provider } from 'react-redux' +import { Router } from 'react-router-dom' import { applyMiddleware, compose, createStore } from 'redux' import computeThemeColours from './components/themeColours' -import Layout from './containers/Layout' +import { defaultTracker, TrackerProvider } from './components/withTracker' +import Layout from './inFranceApp' import trackDomainActions from './middlewares/trackDomainActions' import reducers from './reducers/reducers' import { @@ -15,7 +20,6 @@ import { retrievePersistedSimulation } from './storage/persist' import { getIframeOption, getUrl } from './utils' -import { defaultTracker, TrackerProvider } from './components/withTracker' let tracker = defaultTracker if (process.env.NODE_ENV === 'production') { @@ -49,10 +53,16 @@ let store = createStore(reducers, initialStore, enhancer) let anchor = document.querySelector('#js') persistSimulation(store) +const history = createHistory() + let App = ({ store }) => ( - + + + + + ) diff --git a/source/inFranceApp/Landing.js b/source/inFranceApp/Landing.js new file mode 100644 index 000000000..40ccc11ff --- /dev/null +++ b/source/inFranceApp/Landing.js @@ -0,0 +1,9 @@ +import React from 'react' + +const Landing = () => ( +
+

How to settle a business in France

+
+) + +export default Landing diff --git a/source/inFranceApp/index.js b/source/inFranceApp/index.js new file mode 100644 index 000000000..c73b7f282 --- /dev/null +++ b/source/inFranceApp/index.js @@ -0,0 +1,19 @@ +import React, { Component } from 'react' +import { Route, Switch } from 'react-router-dom' +import withTracker from '../components/withTracker' +import '../containers/reset.css' +import Landing from './Landing' +class Layout extends Component { + componentDidMount() { + this.props.tracker.push(['trackPageView']) + } + render() { + return ( + + + + ) + } +} + +export default withTracker(Layout)