File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
server/client/src/components Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { Link } from 'react-router-dom' ;
3+ import SurveyList from './surveys/SurveyList' ;
34
45const Dashboard = ( ) => {
56 return (
67 < div >
7- Dashboard
8+ < SurveyList />
89 < div className = "fixed-action-btn" >
910 < Link to = "/surveys/new" className = "btn-floating btn-large red" >
1011 < 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