質問編集履歴

1

誤記の修正

2019/09/15 14:22

投稿

khhhhh
khhhhh

スコア5

test CHANGED
File without changes
test CHANGED
@@ -180,7 +180,7 @@
180
180
 
181
181
  const mapStateToProps = state => ({
182
182
 
183
- open: state.MenuIconReducer.open,
183
+ open: state.NavIconReducer.open,
184
184
 
185
185
  })
186
186
 
@@ -572,138 +572,120 @@
572
572
 
573
573
  */
574
574
 
575
+ import React from 'react';
576
+
577
+ import { Route, Switch } from 'react-router-dom'
578
+
579
+ import { makeStyles } from '@material-ui/core/styles'
580
+
581
+ import CssBaseline from '@material-ui/core/CssBaseline'
582
+
583
+ import Header from './components/header'
584
+
585
+ import About from './components/about'
586
+
587
+ import Top from './components/top'
588
+
589
+ import MyPage from './components/mypage'
590
+
591
+ import Login from './components/login'
592
+
593
+ import Signup from './components/signup'
594
+
595
+
596
+
597
+ const useStyles = makeStyles(() => ({
598
+
599
+ root: {
600
+
601
+ },
602
+
603
+ }))
604
+
605
+
606
+
607
+ function App() {
608
+
609
+ const classes = useStyles();
610
+
611
+
612
+
613
+ return (
614
+
615
+ <CssBaseline>
616
+
617
+ <div className={classes.root}>
618
+
619
+ <Header />
620
+
621
+ <Switch>
622
+
623
+ <Route exact path="/" component={Top} />
624
+
625
+ <Route exact path="/mypage" component={MyPage} />
626
+
627
+ <Route exact path="/login" component={Login} />
628
+
629
+ <Route exact path="/signup" component={Signup} />
630
+
631
+ <Route exact path="/about" component={About} />
632
+
633
+ </Switch>
634
+
635
+ </div>
636
+
637
+ </CssBaseline>
638
+
639
+ );
640
+
641
+ }
642
+
643
+
644
+
645
+ export default App;
646
+
647
+ ```
648
+
649
+
650
+
651
+ ```index.js
652
+
653
+ /**
654
+
655
+ * index.js
656
+
657
+ */
658
+
575
659
  import React from 'react'
576
660
 
661
+ import ReactDOM from 'react-dom'
662
+
577
- import { withStyles } from '@material-ui/core/styles'
663
+ import { Provider } from 'react-redux';
578
-
664
+
579
- import AppBar from '@material-ui/core/AppBar'
665
+ import App from './App'
580
-
666
+
581
- import Toolbar from '@material-ui/core/ToolBar'
667
+ import { createStore } from 'redux';
582
-
583
- import Typography from '@material-ui/core/Typography';
668
+
584
-
585
- import NavIcon from './NavIcon'
669
+ import reducers from './reducers';
586
-
587
- import ShareIcon from './ShareIcon'
670
+
588
-
589
- import logo from '../../logo.png'
671
+
590
-
591
-
592
-
593
- const drawerWidth = 250 // Width for Drawer
672
+
594
-
595
-
596
-
597
- const styles = theme => ({
673
+ const store = createStore(reducers)
598
-
599
- appBar: {
674
+
600
-
601
- width: '100%',
675
+
602
-
603
- marginLeft: drawerWidth,
676
+
604
-
605
- [theme.breakpoints.up('md')]: {
606
-
607
- width: `calc(100% - ${drawerWidth}px)`,
608
-
609
- },
610
-
611
- },
612
-
613
- toolBar: {
614
-
615
- },
616
-
617
- title: {
618
-
619
- margin: 'auto',
620
-
621
- },
622
-
623
- logo: {
624
-
625
- width: 20,
626
-
627
- paddingRight: 5,
677
+ ReactDOM.render(
628
-
629
- },
678
+
630
-
631
- })
632
-
633
-
634
-
635
- const Header = ({ classes }) => (
636
-
637
- <div className={classes.header}>
679
+ <Provider store={store}>
638
-
639
- <AppBar className={classes.appBar}>
680
+
640
-
641
- <Toolbar className={classes.toolBar}>
642
-
643
- <NavIcon />
681
+ <App />
644
-
645
- <Typography className={classes.title}>
682
+
646
-
647
- <img src={logo} alt="Header logo" className={classes.logo} />
648
-
649
- *****
650
-
651
- </Typography>
652
-
653
- </Toolbar>
683
+ </Provider>,
654
-
684
+
655
- </AppBar>
685
+ document.getElementById('root')
656
-
657
- </div>
658
686
 
659
687
  )
660
688
 
661
-
662
-
663
- export default withStyles(styles, { withTheme: true })(Header)
664
-
665
- ```
666
-
667
-
668
-
669
- ```index.js
670
-
671
- /**
672
-
673
- * index.js
674
-
675
- */
676
-
677
- import React from 'react'
678
-
679
- import ReactDOM from 'react-dom'
680
-
681
- import { Provider } from 'react-redux';
682
-
683
- import App from './App'
684
-
685
- import { createStore } from 'redux';
686
-
687
- import reducers from './reducers';
688
-
689
-
690
-
691
- const store = createStore(reducers)
692
-
693
-
694
-
695
- ReactDOM.render(
696
-
697
- <Provider store={store}>
698
-
699
- <App />
700
-
701
- </Provider>,
702
-
703
- document.getElementById('root')
704
-
705
- )
706
-
707
689
  ```
708
690
 
709
691