Last active
May 17, 2016 18:36
-
-
Save sinisterra/c1e5f5f99a8c50a2d7f3d74e5a103373 to your computer and use it in GitHub Desktop.
React + Redux + Material UI + Styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import { Provider } from 'react-redux' | |
import AppRouter from './AppRouter' | |
import configureStore from '../store/configureStore' | |
import initialState from '../store/initialState' | |
import getMuiTheme from 'material-ui/styles/getMuiTheme'; | |
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; | |
const store = configureStore(initialState) | |
export default class App extends Component { | |
render() { | |
return ( | |
<Provider store={ store }> | |
<MuiThemeProvider muiTheme={ getMuiTheme() }> | |
<AppRouter/> | |
</MuiThemeProvider> | |
</Provider> | |
) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, applyMiddleware } from 'redux' | |
import thunkMiddleware from 'redux-thunk' | |
import createLogger from 'redux-logger' | |
import rootReducer from '../reducers' | |
const loggerMiddleware = createLogger({collapsed: true}) | |
export default function configureStore(initialState) { | |
return createStore( | |
rootReducer, | |
initialState, | |
applyMiddleware( | |
thunkMiddleware, | |
loggerMiddleware | |
) | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Roboto:300,400,500" rel="stylesheet"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.0.8/angular-material.css"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment