Skip to content

Commit

Permalink
Merge pull request #71 from laem/accueilv2
Browse files Browse the repository at this point in the history
Nouvelle version de l'accueil
  • Loading branch information
laem authored Apr 25, 2020
2 parents 859a20f + ddd0321 commit f7e2da5
Show file tree
Hide file tree
Showing 17 changed files with 708 additions and 913 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v12
58 changes: 31 additions & 27 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current'
module.exports = api => {
// This caches the Babel config by environment.
api.cache.using(() => process.env.NODE_ENV)
return {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
}
],
'@babel/react',
'@babel/preset-typescript'
],
'@babel/react',
'@babel/preset-typescript'
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-syntax-dynamic-import',
'react-hot-loader/babel',
['webpack-alias', { config: './source/webpack.dev.js' }],
[
'ramda',
{
useES: true
}
],
'babel-plugin-styled-components'
]
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-syntax-dynamic-import',
!api.env('production') && 'react-refresh/babel',
['webpack-alias', { config: './source/webpack.dev.js' }],
[
'ramda',
{
useES: true
}
],
'babel-plugin-styled-components'
].filter(Boolean)
}
}
3 changes: 0 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,5 @@ <h3>
Intl : SAFARI 9 & 10.0 https://caniuse.com/#search=Intl
-->
<script src="https://polyfill.io/v3/polyfill.min.js?features=Intl.~locale.en%2CIntl.~locale.fr%2CIntersectionObserver"></script>
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script nomodule src="<%= chunk %>.legacy.bundle.js"></script>
<% } %>
</body>
</html>
10 changes: 5 additions & 5 deletions manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "Futureco",
"short_name": "Futureco",
"description": "Découvrir l'impact de nos gestes quotidiens sur le climat",
"description": "L'impact climat de tes gestes quotidiens",
"display": "standalone",
"lang": "fr",
"orientation": "portrait-primary",
"theme_color": "#3742fa",
"theme_color": "#2975D1",
"icons": [
{
"src": "/source/sites/publicodes/logo.png",
"sizes": "48x48",
"type": "image/png"
"src": "/images/logo.svg",
"sizes": "144x144",
"type": "image/svg+xml"
}
]
}
42 changes: 10 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
{
"name": "mon-entreprise",
"name": "futureco",
"license": "MIT",
"version": "1.2.3",
"description": "Library to compute the french social security contributions. Also a website that explains the calculations, and a generic engine to build cool forms that asks the question needed to compute an objective.",
"main": "./dist/engine.js",
"files": [
"dist/engine.js"
],
"repository": {
"type": "git",
"url": "https://github.com/betagouv/mon-entreprise.git"
},
"engines": {
"node": ">=8.10.0"
"url": "https://github.com/laem/futureco.git"
},
"browserslist": [
"> 1% in FR",
"not ie < 11"
"> 1% in FR"
],
"dependencies": {
"@babel/polyfill": "^7.6.0",
"@babel/runtime": "^7.6.0",
"@microlink/react": "^4.0.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.2.0",
"classnames": "^2.2.5",
"color-convert": "^1.9.2",
"core-js": "^3.2.1",
Expand All @@ -37,10 +29,10 @@
"ramda": "^0.26.1",
"raven-for-redux": "^1.3.1",
"raven-js": "^3.26.4",
"react": "^16.8.6",
"react": "^16.13.1",
"react-addons-css-transition-group": "^15.6.2",
"react-color": "^2.14.0",
"react-dom": "npm:@hot-loader/react-dom",
"react-dom": "^16.13.1",
"react-easy-emoji": "^1.2.0",
"react-helmet": "6.0.0-beta",
"react-highlight-words": "^0.11.0",
Expand All @@ -50,6 +42,7 @@
"react-monaco-editor": "^0.30.2",
"react-number-format": "^4.3.1",
"react-redux": "^7.0.3",
"react-refresh": "^0.8.1",
"react-router": "^5.1.1",
"react-router-dom": "^5.1.1",
"react-spring": "=8.0.27",
Expand All @@ -69,18 +62,16 @@
},
"scripts": {
"postinstall": "node source/scripts/postinstall.js",
"compile": "yarn run webpack --config source/webpack.prod.js && yarn run webpack --config source/webpack.prod.legacyBrowser.js",
"compile": "NODE_ENV=production yarn run webpack --config source/webpack.prod.js",
"stats": "webpack --config source/webpack.prod.js --profile --json > stats.json",
"eslint-check": "eslint --print-config .eslintrc | eslint-config-prettier-check",
"eslint": "LIST=`git diff --cached --name-only --diff-filter=AMR HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi",
"externalize": "node source/externalize.js",
"heroku-postbuild": "yarn install --production=false && yarn compile",
"pretest": "LIST=`git diff --name-only --diff-filter=AMR HEAD^..HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi",
"start": "node source/server.js",
"test-inversions": "yarn test-watch --grep 'inversions'",
"test-meca": "yarn test-watch --grep 'Mécanismes'",
"test-rules": "yarn test-watch --grep 'notre base de règles'",
"test-cypress": "yarn run cypress run",
"test-watch": "yarn test-common --watch",
"test-common": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require mock-local-storage --require test/helpers/browser.js \"./{,!(node_modules)/**/}!(webpack).test.js\"",
"test": "yarn test-common",
Expand All @@ -89,15 +80,7 @@
"test-lib": "mocha-webpack --webpack-config source/webpack.lib.js --require source-map-support/register --include componentTestSetup.js --require mock-local-storage test/library.test.js",
"test-expressions": "yarn test-common --grep 'Suite expressions'",
"test-units": "mocha-webpack --webpack-config source/webpack.test.js --require source-map-support/register --include componentTestSetup.js --require mock-local-storage --require test/helpers/browser.js test/units.test.js",
"test-regressions": "jest",
"type-check": "tsc --noEmit",
"compile-lib": "yarn webpack --config source/webpack.lib.js",
"compile-dev": "FR_SITE='http://localhost:5000${path}' EN_SITE='http://localhost:5001${path}' yarn run compile",
"mon-entreprise:serve": "PORT=5000 serve --config serve.mon-entreprise.json --no-clipboard",
"mon-entreprise:test": "cypress open --browser chromium",
"mycompanyinfrance:serve": "PORT=5001 serve --config serve.infrance.json --no-clipboard",
"mycompanyinfrance:test": "cypress open --browser chromium --env language=en --config baseUrl=http://localhost:8080/infrance",
"serve-dev": "yarn run mon-entreprise:serve & yarn run mycompanyinfrance:serve"
"type-check": "tsc --noEmit"
},
"devDependencies": {
"@babel/core": "^7.6.4",
Expand Down Expand Up @@ -167,10 +150,9 @@
"monaco-editor-webpack-plugin": "^1.7.0",
"nearley-loader": "^2.0.0",
"postcss-loader": "^2.1.2",
"prettier": "^1.19.1",
"prettier": "^2.0.5",
"ramda-fantasy": "^0.8.0",
"raw-loader": "^0.5.1",
"react-hot-loader": "^4.12.15",
"serve": "^11.1.0",
"serve-handler": "^6.1.1",
"sinon": "^4.5.0",
Expand All @@ -189,9 +171,5 @@
"worker-loader": "^2.0.0",
"yaml-jest": "^1.0.5",
"yaml-loader": "^0.5.0"
},
"optionalDependencies": {
"cypress": "^3.6.1",
"prerender-spa-plugin": "^3.4.0"
}
}
3 changes: 1 addition & 2 deletions source/sites/publicodes/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,4 @@ class App extends Component {
}
}

let devMode = process.env.NODE_ENV !== 'production'
export default devMode ? require('react-hot-loader').hot(module)(App) : App
export default App
9 changes: 3 additions & 6 deletions source/sites/publicodes/Landing.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import React, { useState } from 'react'
import React from 'react'
import ContributionButton from './ContributionButton'
import DocumentationButton from './DocumentationButton'
import Search from './Search'
import Suggestions from './Suggestions'

export default () => {
const [input, setInput] = useState('')
return (
<div>
<h1 css="margin-top: 1rem; font-size: 140%; line-height: 1.2em">
Découvre l'impact de chaque geste du quotidien !
</h1>
<Search {...{ input, setInput }} />
<Suggestions {...{ input }} />
<Suggestions />
<DocumentationButton />
<ContributionButton {...{ input }} />
<ContributionButton />
</div>
)
}
2 changes: 1 addition & 1 deletion source/sites/publicodes/Scenarios.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default () => {
border: 4px solid var(--color)
`
: `border: 4px solid white`}
: 'border: 4px solid white'}
`}
>
<h2>
Expand Down
Loading

0 comments on commit f7e2da5

Please sign in to comment.