Last active
April 9, 2018 07:51
-
-
Save dbismut/8659e66d45c82e2d06b4f3759695bbeb to your computer and use it in GitHub Desktop.
Part 1 - The Preview component
This file contains hidden or 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
| import React, { PureComponent } from 'react'; | |
| export default class Preview extends PureComponent { | |
| render() { | |
| const { id, image, title, onClick } = this.props; | |
| return ( | |
| <div | |
| data-id={id} | |
| className="preview cover" | |
| onClick={onClick} | |
| style={{ backgroundImage: `url(/img/${image})` }} | |
| > | |
| <h1 className="title">{title}</h1> | |
| </div> | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment