11import React from 'react' ;
22import PropTypes from 'prop-types' ;
3- import { BrowserRouter as Router , Route , Link } from 'react-router-dom' ;
3+ import { BrowserRouter as Router , Route } from 'react-router-dom' ;
44import { ThemeProvider } from 'styled-components' ;
55import { connect } from 'react-redux' ;
66import styleLight from './styles/hljs/hljs.light' ;
77import styleDark from './styles/hljs/hljs.dark' ;
8- import ToggleButton from './components/ToggleButton' ;
9- import Title from './components/Title' ;
8+ import Header from './components/Header' ;
109import GlobalStyle from './styles/global' ;
10+ import { themeCommon } from './styles/themes/theme.common' ;
1111import { themeLight } from './styles/themes/theme.light' ;
1212import { themeDark } from './styles/themes/theme.dark' ;
1313import Game from './pages/Game' ;
@@ -17,29 +17,19 @@ const Layout = props => {
1717 const { mode } = props ;
1818
1919 let style = styleLight ;
20- let theme = themeLight ;
20+ let theme = { ... themeCommon , ... themeLight } ;
2121
2222 if ( props . mode === 'dark' ) {
2323 style = styleDark ;
24- theme = themeDark ;
24+ theme = { ... themeCommon , ... themeDark } ;
2525 }
2626
2727 return (
2828 < Router >
2929 < ThemeProvider theme = { theme } >
3030 < React . Fragment >
3131 < GlobalStyle mode = { mode } />
32-
33- < Link to = "/" > Game</ Link >
34- < Link to = "/about" > About</ Link >
35- < a href = "//github.com/zoltantothcom/javascript-patterns" target = "_blank" >
36- GitHub
37- </ a >
38-
39- < Route exact path = "/" render = { ( ) => < ToggleButton control = "js" /> } />
40- < ToggleButton control = "mode" />
41-
42- < Title />
32+ < Header />
4333
4434 < Route exact path = "/" render = { props => < Game { ...props } style = { style } /> } />
4535 < Route path = "/about" component = { About } />
0 commit comments