Skip to content

Commit fdd9052

Browse files
committedMay 27, 2019
fix: display space description in media card
closes #57
1 parent 9b7a3e2 commit fdd9052

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed
 

‎src/components/common/MediaCard.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const MediaCard = props => {
3030
<Typography gutterBottom variant="h5" component="h2">
3131
{name}
3232
</Typography>
33-
<Typography component="p">{text}</Typography>
33+
<Typography component="p" dangerouslySetInnerHTML={{ __html: text }} />
3434
</CardContent>
3535
<CardActions>{button}</CardActions>
3636
</Card>
@@ -41,8 +41,12 @@ MediaCard.propTypes = {
4141
classes: PropTypes.shape({ media: PropTypes.string.isRequired }).isRequired,
4242
name: PropTypes.string.isRequired,
4343
image: PropTypes.string.isRequired,
44-
text: PropTypes.string.isRequired,
44+
text: PropTypes.string,
4545
button: PropTypes.shape(Button).isRequired,
4646
};
4747

48+
MediaCard.defaultProps = {
49+
text: '',
50+
};
51+
4852
export default withStyles(styles)(MediaCard);

‎src/components/space/SpaceGrid.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class SpaceGrid extends Component {
8181
const { spaces, classes, history } = this.props;
8282

8383
const MediaCards = spaces.map(space => {
84-
const { id, name, image = {}, text } = space;
84+
const { id, name, image = {}, description } = space;
8585
const { replace } = history;
8686
const ViewButton = (
8787
<Button
@@ -90,6 +90,7 @@ class SpaceGrid extends Component {
9090
color="primary"
9191
id={Number(id)}
9292
onClick={() => replace(`/space/${id}`)}
93+
fullWidth
9394
>
9495
<RemoveRedEyeIcon className={classes.leftIcon} />
9596
View
@@ -101,7 +102,7 @@ class SpaceGrid extends Component {
101102
key={id}
102103
name={name}
103104
image={this.generateThumbnail({ image })}
104-
text={text}
105+
text={description}
105106
button={ViewButton}
106107
/>
107108
</Grid>

0 commit comments

Comments
 (0)
Please sign in to comment.