Skip to content

Commit

Permalink
Updated state object and added loader to polls section
Browse files Browse the repository at this point in the history
  • Loading branch information
abohannon committed Apr 1, 2018
1 parent f5c5710 commit a54849f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions client/src/components/LandingPage/PollsSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ class PollsSection extends Component {
gridContainerStyle,
titleStyle,
} = styles;

console.log(this.props.polls.loading);
return (
<div style={pollsSectionContainerStyle}>
<h2 id="polls" style={titleStyle}>Latest Polls</h2>
<div style={gridContainerStyle}>
{ !this.props.polls
{ this.props.polls.loading
? <Loader />
: <GridDisplay polls={this.props.polls} />
: <GridDisplay polls={this.props.polls.all} />
}
</div>
<div style={{ color: COLOR_BLUE_80 }}>
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/LandingPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ class LandingPage extends Component {
}
}

const mapStateToProps = state => ({ polls: state.polls.all });
const mapStateToProps = state => ({ polls: state.polls });

export default connect(mapStateToProps, { pollsFetch })(LandingPage);

0 comments on commit a54849f

Please sign in to comment.