Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created September 8, 2021 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/b83f1a4504c7e1f2b4e407270972f944 to your computer and use it in GitHub Desktop.
Save velotiotech/b83f1a4504c7e1f2b4e407270972f944 to your computer and use it in GitHub Desktop.
thumbClick = (index) => {
const urlCreater = window.URL || window.webkitURL;
try {
this.setState({
openLightBox: true
});
Storage.get(this.state.photoList[index].src,{download: true}).then(data=>{
let image = urlCreater.createObjectURL(data.Body);
this.setState({
lightBoxImg : image
});
});
} catch (error) {
console.log(error);
this.setState({
openLightBox: false,
lightBoxImg : null
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment