import 'core-js/fn/promise' import React from 'react' import { render } from 'react-dom' import { connect, Provider } from 'react-redux' import { createStore } from 'redux' import reducers from './reducers/reducers' import { changeThemeColour } from './actions' import Layout from './containers/Layout' import { SliderPicker } from 'react-color' import { rulesFr } from 'Engine/rules' let tracker = { push: () => {}, connectToHistory: history => history } let store = createStore(reducers(tracker, rulesFr)) @connect( state => ({ couleur: state.themeColours.colour }), dispatch => ({ changeColour: colour => dispatch(changeThemeColour(colour)) }) ) class MyComponent extends React.Component { changeColour = ({ hex }) => this.props.changeColour(hex) render() { return (
Visualisez sur cette page l’apparence du module pour différentes couleurs principales.
La couleur sélectionnée, à déclarer comme attribut "data-couleur" du script sur votre page est :{' '} {this.props.couleur}