Skip to content

Commit

Permalink
fix: show message when no spaces are available
Browse files Browse the repository at this point in the history
closes #91
  • Loading branch information
juancarlosfarah committed Jun 12, 2019
1 parent edc96b7 commit d187018
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/space/SpaceGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class SpaceGrid extends Component {
render() {
const { spaces, classes, history } = this.props;

// spaces is a set to mapping through it will return a set
const MediaCards = spaces.map(space => {
const { id, name, image = {}, description } = space;
const { replace } = history;
Expand Down Expand Up @@ -108,7 +109,8 @@ class SpaceGrid extends Component {
</Grid>
);
});
if (MediaCards.length === 0) {

if (!MediaCards.size) {
return (
<Typography variant="h5" color="inherit">
No spaces available.
Expand Down

0 comments on commit d187018

Please sign in to comment.