File tree 2 files changed +25
-1
lines changed
server/client/src/components
2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { Link } from 'react-router-dom' ;
3
+ import SurveyList from './surveys/SurveyList' ;
3
4
4
5
const Dashboard = ( ) => {
5
6
return (
6
7
< div >
7
- Dashboard
8
+ < SurveyList />
8
9
< div className = "fixed-action-btn" >
9
10
< Link to = "/surveys/new" className = "btn-floating btn-large red" >
10
11
< i className = "material-icons" > add</ i >
Original file line number Diff line number Diff line change
1
+ import React , { Component } from 'react' ;
2
+ import { connect } from 'react-redux' ;
3
+ import { fetchSurveys } from '../../actions' ;
4
+
5
+ class SurveyList extends Component {
6
+ componentDidMount ( ) {
7
+ this . props . fetchSurveys ( ) ;
8
+ }
9
+
10
+ render ( ) {
11
+ return (
12
+ < div >
13
+ SurveyList
14
+ </ div >
15
+ ) ;
16
+ }
17
+ }
18
+
19
+ function mapStateToProps ( { surveys } ) {
20
+ return { surveys } ;
21
+ }
22
+
23
+ export default connect ( mapStateToProps , { fetchSurveys } ) ( SurveyList ) ;
You can’t perform that action at this time.
0 commit comments