Add darkmode

This commit is contained in:
GHOSCHT 2020-08-01 16:29:29 +02:00
parent 760b8d06d0
commit 152efeeb99

View file

@ -4,17 +4,36 @@ import Test from './components/Test';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { createStore } from 'redux'; import { createStore } from 'redux';
import rootReducer from './store/reducers'; import rootReducer from './store/reducers';
import CssBaseline from '@material-ui/core/CssBaseline';
import createMuiTheme from '@material-ui/core/styles/createMuiTheme';
import { ThemeProvider } from '@material-ui/core/styles';
import LampButtonList from './components/LampButtonList';
const store = createStore( const store = createStore(
rootReducer, rootReducer,
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
); );
const darkTheme = createMuiTheme({
palette: {
type: 'dark',
primary: {
main: '#23272A',
},
secondary: {
main: '#7289DA',
},
},
});
const rootElement = document.querySelector(document.currentScript.getAttribute('data-container')); const rootElement = document.querySelector(document.currentScript.getAttribute('data-container'));
ReactDOM.render( ReactDOM.render(
<Provider store={store}> <Provider store={store}>
<Test /> <ThemeProvider theme={darkTheme}>
<CssBaseline />
<LampButtonList />
</ThemeProvider>
</Provider>, </Provider>,
rootElement, rootElement,
); );