rikimaru09-react-image-picker
Advanced tools
Comparing version 1.1.7 to 1.1.8
{ | ||
"name": "rikimaru09-react-image-picker", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "Picks images from gallery", | ||
@@ -5,0 +5,0 @@ "main": "dist/app.js", |
@@ -18,3 +18,4 @@ import React, { Component } from 'react' | ||
image: null, | ||
images: [] | ||
images: [], | ||
picked: Map().set(0, '0e1abaf656c3367fc89f628f0d52ad11.jpg') | ||
} | ||
@@ -24,3 +25,4 @@ } | ||
onPickImage(image) { | ||
this.setState({image}) | ||
const picked = Map().set(image.value, image.src); | ||
this.setState({image, picked}) | ||
} | ||
@@ -32,2 +34,7 @@ | ||
onChangePicked() { | ||
const picked = Map().set(2, '6c800cccebf18c24f51d5fd411818ac8.jpg'); | ||
this.setState({picked}); | ||
} | ||
render() { | ||
@@ -38,6 +45,7 @@ return ( | ||
<h3>Single Select</h3> | ||
<button onClick={this.onChangePicked.bind(this)}>Test</button> | ||
<ImagePicker | ||
images={imageList.map((image, i) => ({src: image, value: i}))} | ||
onPick={this.onPickImage.bind(this)} | ||
picked={Map().set(0, '0e1abaf656c3367fc89f628f0d52ad11.jpg')} | ||
picked={this.state.picked} | ||
/> | ||
@@ -44,0 +52,0 @@ <textarea rows="4" cols="100" value={this.state.image && JSON.stringify(this.state.image)} disabled/> |
@@ -19,5 +19,3 @@ import React, { Component } from 'react'; | ||
componentWillReceiveProps(nextProps) { | ||
if(this.props.picked.get(0) !== nextProps.picked.get(0)) { | ||
this.setState({picked: nextProps.picked}); | ||
} | ||
this.setState({picked: nextProps.picked}); | ||
} | ||
@@ -24,0 +22,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
294154
604