Skip to content

Commit

Permalink
Set router, Create Header, Login, Signup
Browse files Browse the repository at this point in the history
  • Loading branch information
KoheiAsano committed Dec 18, 2018
1 parent c0edf93 commit 29d5bb5
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/components/Header/index.js
@@ -0,0 +1,10 @@
import React from 'react'
const Header = ({history}) => (
<div>
<button onClick={() => history.push("/")}>ToDo</button>
<button onClick={() => history.push("/login")}>Login</button>
<button onClick={() => history.push("/signup")}>SignUp</button>
</div>
)

export default Header
8 changes: 8 additions & 0 deletions src/components/Login/index.js
@@ -0,0 +1,8 @@
import React from 'react'
const Login = () => (
<div>
<p>Login</p>
</div>
)

export default Login
8 changes: 8 additions & 0 deletions src/components/Signup/index.js
@@ -0,0 +1,8 @@
import React from 'react'
const Signup = () => (
<div>
<p>Signup</p>
</div>
)

export default Signup
13 changes: 12 additions & 1 deletion src/index.js
@@ -1,7 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Header from './components/Header';
import App from './components/App';
import Login from './components/Login';
import Signup from './components/Signup';

import {BrowserRouter,Route} from 'react-router-dom';
import { Provider } from 'react-redux'
import { createStore } from 'redux'
import rootReducer from './reducers'
Expand All @@ -10,7 +14,14 @@ const store = createStore(rootReducer);

ReactDOM.render(
<Provider store={store}>
<App />
<BrowserRouter>
<div>
<Route path="/" component={ Header } />
<Route exact path="/" component={ App } />
<Route exact path="/login" component={ Login } />
<Route exact path="/signup" component={ Signup } />
</div>
</BrowserRouter>
</Provider>,
document.getElementById('root')
);

0 comments on commit 29d5bb5

Please sign in to comment.