diff --git a/src/components/FlameLinkCollectionGallery.js b/src/components/FlameLinkCollectionGallery.js index a79d728..8f4910b 100644 --- a/src/components/FlameLinkCollectionGallery.js +++ b/src/components/FlameLinkCollectionGallery.js @@ -61,6 +61,7 @@ class FlameLinkCollectionGallery extends Component { getGalleryInfo(schemaDetails, schemaContent) { var key; var mediaNums = [] + for (var val in schemaDetails) { key = schemaDetails[val].key } @@ -72,10 +73,11 @@ class FlameLinkCollectionGallery extends Component { for (var val3 in global.mediaIDs) { mediaNums.push(val3) } + return mediaNums.map(this.createGallery); } - createGallery(num) { + createGallery = num => { return } @@ -85,7 +87,7 @@ class FlameLinkCollectionGallery extends Component { return ( {this.getGalleryInfo(this.state.schemaDetails, this.state.schemaContent)} - + {this.state.schemaDescription} diff --git a/src/components/FlameLinkCollectionGalleryContent.js b/src/components/FlameLinkCollectionGalleryContent.js index 4222da8..9e34d5e 100644 --- a/src/components/FlameLinkCollectionGalleryContent.js +++ b/src/components/FlameLinkCollectionGalleryContent.js @@ -9,23 +9,23 @@ class FlameLinkCollectionGalleryContent extends Component { global.galleryImages = []; this.state = { - mediaURL: '', + mediaURL: '', } flamelinkApp.storage.getURL(global.mediaIDs[this.props.num]) - .then(url => this.setState({ - mediaURL: url - })) - } + .then(url => this.setState({ + mediaURL: url + })) + } - addURLs(){ - if(this.state.mediaURL === ''){ - } - else{ + addURLs = () => { + if (this.state.mediaURL === '') { + } else { var element = {} element.original = this.state.mediaURL; global.galleryImages.push(element); } + return null; } diff --git a/src/components/RenderGallery.js b/src/components/RenderGallery.js index 19c8af6..ce87837 100644 --- a/src/components/RenderGallery.js +++ b/src/components/RenderGallery.js @@ -8,29 +8,28 @@ class RenderGallery extends Component { super(); this.state = { - showThumbnails: false, - showIndex: true, - showBullets: true, - mounted: false, + showThumbnails: false, + showIndex: true, + showBullets: true, + mounted: false, } - } - - componentDidMount(){ - this.setState({mounted: true}) } - - _onImageLoad(event) { - console.debug('loaded image', event.target.src); - } + + componentDidMount() { + this.setState({ mounted: true }) + } + + _onImageLoad = event => { + console.debug('loaded image', event.target.src); + } render() { - - return( - );