parent
8fbcefcf10
commit
f0d2370d5c
@ -1,3 +1,4 @@ |
|||||||
export const PAGES = { |
export const PAGES = { |
||||||
login: '/login', |
login: '/login', |
||||||
|
register: '/register', |
||||||
} |
} |
||||||
|
|||||||
@ -1,12 +1,33 @@ |
|||||||
import React from 'react' |
import React from 'react' |
||||||
|
import { |
||||||
|
Router, |
||||||
|
Route, |
||||||
|
Redirect, |
||||||
|
} from 'react-router-dom' |
||||||
|
import { createBrowserHistory } from 'history' |
||||||
|
|
||||||
|
import { GlobalStyles } from 'features/GlobalStyles' |
||||||
import { Theme } from 'features/Theme' |
import { Theme } from 'features/Theme' |
||||||
import { Login } from 'features/Login' |
import { Login } from 'features/Login' |
||||||
import { GlobalStyles } from 'features/GlobalStyles' |
import { Register } from 'features/Register' |
||||||
|
import { PAGES } from 'config' |
||||||
|
|
||||||
|
const history = createBrowserHistory() |
||||||
|
|
||||||
export const App = () => ( |
export const App = () => ( |
||||||
<Theme> |
<Router history={history}> |
||||||
<GlobalStyles /> |
<Theme> |
||||||
<Login /> |
<GlobalStyles /> |
||||||
</Theme> |
|
||||||
|
<Route path={PAGES.login}> |
||||||
|
<Login /> |
||||||
|
</Route> |
||||||
|
|
||||||
|
<Route path={PAGES.register}> |
||||||
|
<Register /> |
||||||
|
</Route> |
||||||
|
|
||||||
|
<Redirect to={PAGES.login} /> |
||||||
|
</Theme> |
||||||
|
</Router> |
||||||
) |
) |
||||||
|
|||||||
@ -0,0 +1,3 @@ |
|||||||
|
import React from 'react' |
||||||
|
|
||||||
|
export const Register = () => <div>Registration page</div> |
||||||
Loading…
Reference in new issue