Last active
November 30, 2017 08:16
-
-
Save kory33/d5530549b0f0fb10791038b92f34f13f to your computer and use it in GitHub Desktop.
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, { Component } from 'react'; | |
| export default class Thum extends Component { | |
| constructor(props) { | |
| super(props) | |
| this.state = { | |
| thums: { | |
| main: 'sample/6.png', | |
| sub: ['sample/1.png', 'sample/2.png', 'sample/3.png'] | |
| } | |
| } | |
| } | |
| handleSubThumClick(thum, e) { | |
| // TODO | |
| } | |
| render() { | |
| return ( | |
| <div id="thums"> | |
| <div id="thum_1"> | |
| <img class="thum_1 blur" src={this.state.thums.main} alt="" width="100%" height="100%" style={{ 'object-fit': 'cover' }} /> | |
| <img class="thum_1" src={this.state.thums.main} alt="" width="100%" height="100%" /> | |
| </div> | |
| <div class="thum_sub"> | |
| {this.state.thums.sub.map(thum => | |
| <img alt="" height="100%", src={thum} onClick={e => this.handleSubThumClick(thum, e)}> | |
| )} | |
| </div> | |
| </div> | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment