-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// @flow | ||
import React, { Component } from 'react'; | ||
import { connect } from 'react-redux'; | ||
import AppBar from 'material-ui/AppBar'; | ||
|
||
function mapStateToProps(state: Object): Object { | ||
return {}; | ||
} | ||
|
||
function mapDispatchToProps(dispatch: Function): Object { | ||
return {}; | ||
} | ||
|
||
class MainContainer extends Component { | ||
|
||
props: {}; | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<AppBar title={'Template App'} /> | ||
<h1>HELLO WORLD</h1> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(MainContainer); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import { Provider } from 'react-redux'; | ||
import getMuiTheme from 'material-ui/styles/getMuiTheme'; | ||
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; | ||
import injectTapEventPlugin from 'react-tap-event-plugin'; | ||
import configureStore from './store/configure_store'; | ||
import MainContainer from './containers/main_container'; | ||
|
||
export const store = configureStore(); | ||
|
||
// https://github.com/callemall/material-ui/issues/4670 | ||
injectTapEventPlugin(); | ||
|
||
ReactDOM.render( | ||
<Provider store={store}> | ||
<MuiThemeProvider muiTheme={getMuiTheme()}> | ||
<MainContainer /> | ||
</MuiThemeProvider> | ||
</Provider>, | ||
document.getElementById('root'), | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { routerReducer } from 'react-router-redux'; | ||
import { combineReducers } from 'redux'; | ||
|
||
const rootReducer = combineReducers({ | ||
routing: routerReducer, | ||
}); | ||
|
||
export default rootReducer; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// @flow | ||
import 'babel-polyfill'; | ||
// import { fork } from 'redux-saga/effects'; | ||
// import { watchFoo } from './foo'; | ||
|
||
export default function* rootSaga(): Generator<any, any, any> { | ||
yield [ | ||
// fork(watchFoo), | ||
]; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { createStore, applyMiddleware, compose } from 'redux'; | ||
import createLogger from 'redux-logger'; | ||
import createSagaMiddleware from 'redux-saga'; | ||
import { routerMiddleware } from 'react-router-redux'; | ||
import { browserHistory } from 'react-router'; | ||
import rootSaga from '../sagas/index'; | ||
import rootReducer from '../reducers'; | ||
|
||
const routing = routerMiddleware(browserHistory); | ||
const sagaMiddleware = createSagaMiddleware(); | ||
const enhancer = compose( | ||
applyMiddleware( | ||
routing, | ||
sagaMiddleware, | ||
createLogger(), | ||
), | ||
); | ||
|
||
function configureStore(initialState) { | ||
const store = createStore(rootReducer, initialState, enhancer); | ||
sagaMiddleware.run(rootSaga); | ||
return store; | ||
} | ||
|
||
export default configureStore; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<html lang='ja'> | ||
<head> | ||
<meta charset="utf-8"></meta> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>title 欄</title> | ||
</head> | ||
<body style="margin: 0px; padding: 0px"> | ||
<div id="root"></div> | ||
</body> | ||
<script src="js/bundle.js"></script> | ||
</html> |