2018-01-15 14:47:32 +00:00
|
|
|
|
import 'core-js/fn/promise'
|
|
|
|
|
import React from 'react'
|
2018-06-12 10:21:36 +00:00
|
|
|
|
import { SliderPicker } from 'react-color'
|
2018-01-15 14:47:32 +00:00
|
|
|
|
import { render } from 'react-dom'
|
|
|
|
|
import { connect, Provider } from 'react-redux'
|
|
|
|
|
import { createStore } from 'redux'
|
2018-06-15 14:14:09 +00:00
|
|
|
|
import Layout from './containers/Layout'
|
2018-06-19 09:55:01 +00:00
|
|
|
|
import reducers from './reducers/reducers'
|
2018-05-03 12:22:15 +00:00
|
|
|
|
|
2018-06-15 14:14:09 +00:00
|
|
|
|
let store = createStore(reducers)
|
2018-01-15 14:47:32 +00:00
|
|
|
|
|
|
|
|
|
@connect(
|
|
|
|
|
state => ({ couleur: state.themeColours.colour }),
|
|
|
|
|
dispatch => ({
|
2018-06-15 14:14:09 +00:00
|
|
|
|
changeColour: colour => dispatch({ type: 'CHANGE_THEME_COLOUR', colour })
|
2018-01-15 14:47:32 +00:00
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
class MyComponent extends React.Component {
|
|
|
|
|
changeColour = ({ hex }) => this.props.changeColour(hex)
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<p className="indication">
|
2018-06-12 10:21:36 +00:00
|
|
|
|
Visualisez sur cette page l’apparence du module pour différentes
|
|
|
|
|
couleurs principales.
|
2018-01-15 14:47:32 +00:00
|
|
|
|
</p>
|
|
|
|
|
<SliderPicker
|
|
|
|
|
color={this.props.couleur}
|
|
|
|
|
onChangeComplete={this.changeColour}
|
|
|
|
|
/>
|
|
|
|
|
<p className="indication">
|
2018-05-03 12:45:35 +00:00
|
|
|
|
La couleur sélectionnée, à déclarer comme attribut
|
|
|
|
|
"data-couleur" du script sur votre page est :{' '}
|
|
|
|
|
<b>{this.props.couleur}</b>
|
2018-01-15 14:47:32 +00:00
|
|
|
|
</p>
|
2018-06-19 09:55:01 +00:00
|
|
|
|
<Layout />
|
2018-01-15 14:47:32 +00:00
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
render(
|
|
|
|
|
<Provider store={store}>
|
|
|
|
|
<MyComponent />
|
|
|
|
|
</Provider>,
|
|
|
|
|
document.querySelector('#coulorChooser')
|
|
|
|
|
)
|