Skip to content

Instantly share code, notes, and snippets.

@dbismut
Last active April 9, 2018 07:51
Show Gist options
  • Select an option

  • Save dbismut/8659e66d45c82e2d06b4f3759695bbeb to your computer and use it in GitHub Desktop.

Select an option

Save dbismut/8659e66d45c82e2d06b4f3759695bbeb to your computer and use it in GitHub Desktop.
Part 1 - The Preview component
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