-
Notifications
You must be signed in to change notification settings - Fork 2
Tile Item
brandonk1234 edited this page Feb 23, 2017
·
2 revisions
Similar to the DetailTileItem, this element is used to display a title and an image to give the user an idea of what content will be shown if they were to click the action button in the middle.
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
-
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
<TileItem
image="http://placehold.it/250x150"
icon="play"
title="Tile item one Tile item one Tile item ones Tile item one"
hasBeenBookmarked={this.state.hasBeenBookmarked}
hasBeenLiked={this.state.hasBeenLiked}
onBookmarkClicked={this.onBookmarkedClicked}
onLikeClicked={this.onLikedClicked}
onClick={this.onClick}
/>
// ...React Component
getInitialState: function() {
return {
hasBeenBookmarked: false,
hasBeenLiked: false
};
},
onClick: function() {
console.log("Tile Item has been clicked");
},
onBookmarkedClicked: function(isBookmarked) {
console.log("is this item bookmarked", isBookmarked)
this.setState({
hasBeenBookmarked: isBookmarked
});
},
onLikedClicked: function(isLiked) {
console.log("is this item liked", isLiked)
this.setState({
hasBeenLiked: isLiked
});
},