質問するログイン新規登録

質問編集履歴

1

誤記の修正

2019/09/15 14:22

投稿

khhhhh
khhhhh

スコア5

title CHANGED
File without changes
body CHANGED
@@ -89,7 +89,7 @@
89
89
  import NavIcon from '../components/header/NavIcon'
90
90
 
91
91
  const mapStateToProps = state => ({
92
- open: state.MenuIconReducer.open,
92
+ open: state.NavIconReducer.open,
93
93
  })
94
94
 
95
95
  const mapDispatchToProps = dispatch => {
@@ -285,51 +285,42 @@
285
285
  /**
286
286
  * App.js
287
287
  */
288
- import React from 'react'
288
+ import React from 'react';
289
+ import { Route, Switch } from 'react-router-dom'
289
- import { withStyles } from '@material-ui/core/styles'
290
+ import { makeStyles } from '@material-ui/core/styles'
290
- import AppBar from '@material-ui/core/AppBar'
291
+ import CssBaseline from '@material-ui/core/CssBaseline'
291
- import Toolbar from '@material-ui/core/ToolBar'
292
+ import Header from './components/header'
292
- import Typography from '@material-ui/core/Typography';
293
+ import About from './components/about'
293
- import NavIcon from './NavIcon'
294
+ import Top from './components/top'
294
- import ShareIcon from './ShareIcon'
295
+ import MyPage from './components/mypage'
295
- import logo from '../../logo.png'
296
+ import Login from './components/login'
297
+ import Signup from './components/signup'
296
298
 
297
- const drawerWidth = 250 // Width for Drawer
298
-
299
- const styles = theme => ({
299
+ const useStyles = makeStyles(() => ({
300
- appBar: {
300
+ root: {
301
- width: '100%',
302
- marginLeft: drawerWidth,
303
- [theme.breakpoints.up('md')]: {
304
- width: `calc(100% - ${drawerWidth}px)`,
305
- },
306
301
  },
307
- toolBar: {
308
- },
309
- title: {
310
- margin: 'auto',
311
- },
312
- logo: {
313
- width: 20,
314
- paddingRight: 5,
315
- },
316
- })
302
+ }))
317
303
 
304
+ function App() {
318
- const Header = ({ classes }) => (
305
+ const classes = useStyles();
319
- <div className={classes.header}>
320
- <AppBar className={classes.appBar}>
321
- <Toolbar className={classes.toolBar}>
322
- <NavIcon />
323
- <Typography className={classes.title}>
324
- <img src={logo} alt="Header logo" className={classes.logo} />
325
- *****
326
- </Typography>
327
- </Toolbar>
328
- </AppBar>
329
- </div>
330
- )
331
306
 
307
+ return (
308
+ <CssBaseline>
309
+ <div className={classes.root}>
310
+ <Header />
311
+ <Switch>
332
- export default withStyles(styles, { withTheme: true })(Header)
312
+ <Route exact path="/" component={Top} />
313
+ <Route exact path="/mypage" component={MyPage} />
314
+ <Route exact path="/login" component={Login} />
315
+ <Route exact path="/signup" component={Signup} />
316
+ <Route exact path="/about" component={About} />
317
+ </Switch>
318
+ </div>
319
+ </CssBaseline>
320
+ );
321
+ }
322
+
323
+ export default App;
333
324
  ```
334
325
 
335
326
  ```index.js