-
Notifications
You must be signed in to change notification settings - Fork 2
Detail Tile Item
brandonk1234 edited this page Feb 23, 2017
·
2 revisions
This element is used to present a snippet of text and an image. An action button is also displayed for the user to interact with if they wanted to find out more about that tile.
The props needed for this component are listed and explained below:
-
image
- This prop must be astring
-
icon
- This prop must be astring
-
title
- This prop must be astring
-
description
- This prop must be astring
-
hasBeenBookmarked
- This prop must be aboolean
-
hasBeenLiked
- This prop must be aboolean
-
onBookmarkClicked
- This prop must be afunction
-
onLikeClicked
- This prop must be afunction
-
onClick
- This prop must be afunction
-
actionButtonText
- This prop must be astring
-
onActionButtonClicked
- This prop must be afunction
-
actionButtonIcon
- This prop must be astring
<DetailTileItem
image="http://placehold.it/350x200"
icon="play"
title="Detailed Tile Item"
description="Playllist description Sed justo libero, fringilla non nisl nec, dignissim vestibulum tellus. Sed sed feugiat quam."
hasBeenBookmarked={this.state.hasBeenBookmarked}
hasBeenLiked={this.state.hasBeenLiked}
onBookmarkClicked={this.onBookmarkClicked}
onLikeClicked={this.onLikeClicked}
onClick={this.onClick}
actionButtonText="Continue"
onActionButtonClicked={this.onActionButtonClicked}
actionButtonIcon="pencil"
/>
// ...React Component
getInitialState: function() {
return {
hasBeenBookmarked: false,
hasBeenLiked: false
};
},
onClick: function() {
console.log("Item has been clicked");
},
onBookmarkClicked: function(isBookmarked) {
console.log("is this item bookmarked", isBookmarked)
this.setState({
hasBeenBookmarked: isBookmarked
});
},
onLikeClicked: function(isLiked) {
console.log("is this item liked", isLiked)
this.setState({
hasBeenLiked: isLiked
});
},
onActionButtonClicked: function() {
console.log("Action button clicked");
},