From 95143d8034bd375769f4ce7e9413bf9083be749a Mon Sep 17 00:00:00 2001 From: wildscotsmen Date: Sun, 25 Nov 2018 13:19:43 -0500 Subject: [PATCH] Fixed startup issue. --- src/components/FlameLinkCollectionGallery.js | 85 ++++++++++---------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/src/components/FlameLinkCollectionGallery.js b/src/components/FlameLinkCollectionGallery.js index adb1703..a79d728 100644 --- a/src/components/FlameLinkCollectionGallery.js +++ b/src/components/FlameLinkCollectionGallery.js @@ -9,22 +9,22 @@ import "react-image-gallery/styles/css/image-gallery.css"; import '../css/FlameLink.css'; const styles = theme => ({ - flamelinkItem: { - marginRight: 20, - marginLeft: 20, - marginTop: 20, - }, + flamelinkItem: { + marginRight: 20, + marginLeft: 20, + marginTop: 20, + }, - flamelinkGallery: { - marginRight: "auto", - marginLeft: "auto", - }, + flamelinkGallery: { + marginRight: "auto", + marginLeft: "auto", + }, - flamelinkGalleryContainer: { - backgroundColor: 'black', - marginTop: 20, - }, - }); + flamelinkGalleryContainer: { + backgroundColor: 'black', + marginTop: 20, + }, +}); class FlameLinkCollectionGallery extends Component { constructor(props) { @@ -39,62 +39,61 @@ class FlameLinkCollectionGallery extends Component { schemaDescription: '', } - flamelinkApp.schemas.getFields(this.props.galleryName, { fields: [ 'title', 'key', 'type', 'gridColumns', 'description', 'options'] }) - .then(result => this.setState({ - schemaDetails: result - })) + flamelinkApp.schemas.getFields(this.props.galleryName, { fields: ['title', 'key', 'type', 'gridColumns', 'description', 'options'] }) + .then(result => this.setState({ + schemaDetails: result + })) flamelinkApp.content.get(this.props.galleryName) .then(result => this.setState({ - schemaContent: result + schemaContent: result })) - if(this.props.showTitle === false){ - } - else{ + if (this.props.showTitle === false) { + } else { flamelinkApp.schemas.get(this.props.galleryName) .then(result => this.setState({ - schemaDescription: result.title + schemaDescription: result.title })) } } - getGalleryInfo(schemaDetails, schemaContent){ + getGalleryInfo(schemaDetails, schemaContent) { var key; var mediaNums = [] - for (var val in schemaDetails){ + for (var val in schemaDetails) { key = schemaDetails[val].key - } - for (var val1 in schemaContent){ - for (var val2 in schemaContent[val1][key]){ + } + for (var val1 in schemaContent) { + for (var val2 in schemaContent[val1][key]) { global.mediaIDs.push(schemaContent[val1][key][val2]); } } - for (var val3 in global.mediaIDs){ - mediaNums.push(val3) - } + for (var val3 in global.mediaIDs) { + mediaNums.push(val3) + } return mediaNums.map(this.createGallery); } - createGallery(num){ - return + createGallery(num) { + return } render() { const { classes } = this.props; - return( - - {this.getGalleryInfo(this.state.schemaDetails, this.state.schemaContent)} - - {this.state.schemaDescription} - - - - - + return ( + + {this.getGalleryInfo(this.state.schemaDetails, this.state.schemaContent)} + + {this.state.schemaDescription} + + + + + ); } }