forked from serodriguez68/react-cheatsheet-udemy-2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Style video list and wire up onVideoSelect
- Loading branch information
1 parent
12ad315
commit efc15b9
Showing
4 changed files
with
31 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.video-item { | ||
display: flex !important; | ||
align-items: center !important; | ||
cursor: pointer; | ||
} | ||
|
||
.video-item.item img { | ||
max-width: 250px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import React from 'react'; | ||
import './VideoItem.css'; | ||
|
||
class VideoItem extends React.Component { | ||
render() { | ||
const video = this.props.video; | ||
return( | ||
<div> | ||
<img src={video.snippet.thumbnails.medium.url} alt=""/> | ||
{video.snippet.title} | ||
const VideoItem = ({ video, onVideoSelect }) => { | ||
return( | ||
<div className="video-item item" onClick={ () => {onVideoSelect(video)} }> | ||
<img className="ui image" src={video.snippet.thumbnails.medium.url} alt=""/> | ||
<div className="content"> | ||
<div className="header"> | ||
{video.snippet.title} | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
</div> | ||
); | ||
}; | ||
|
||
export default VideoItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters