Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (isMobile) {
AppActions.showComponent(componentNames.MAP);
} else {
AppActions.showComponent([componentNames.MAP,componentNames.GALLERY]);
}
}
break;
}
});
} else if (isMobile && visibleComponents.indexOf(componentNames.MAP) >= 0 && visibleComponents.indexOf(componentNames.GALLERY) >= 0) {
this.prevVisibleComponents = [].concat(this.visibleComponents);
this.visibleComponents = [].concat(visibleComponents);
this.showMap(options);
AppActions.hideComponent(componentNames.GALLERY);
} else if (!isMobile &&
((visibleComponents.indexOf(componentNames.MAP) >= 0 && visibleComponents.indexOf(componentNames.GALLERY) < 0) ||
(visibleComponents.indexOf(componentNames.MAP) < 0 && visibleComponents.indexOf(componentNames.GALLERY) >= 0))) {
AppActions.showComponent([componentNames.MAP,componentNames.GALLERY]);
}
}
adds.forEach((component) => {
switch (component) {
case componentNames.INTRO:
this.showIntro(options);
MapActions.selectFeature(false);
AppActions.hideComponent([componentNames.MAP,componentNames.GALLERY,componentNames.SELECTED_SHARES]);
break;
case componentNames.MAP:
this.showMap(options);
AppActions.hideComponent([componentNames.INTRO,componentNames.GALLERY]);
break;
case componentNames.GALLERY:
if (this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
this.showGallery(options);
AppActions.hideComponent([componentNames.INTRO,componentNames.MAP]);
} else {
AppActions.hideComponent(componentNames.GALLERY);
}
break;
}
});
render() {
const builderClasses = Helper.classnames('crowdsource-builder');
return (
<div>
{ this.props.loading.data ? 0 }
saving={this.props.saving}
displayReviewDropdown={this.props.visibleComponents.indexOf(componentNames.MAP) >= 0 || this.props.visibleComponents.indexOf(componentNames.GALLERY) >= 0}
reviewSelection={this.props.review.selection}
changeReviewSelection={this.props.changeReviewableSelection}
settingsAction={this.props.toggleComponent.bind(this,componentNames.SIDE_PANEL_SETTINGS)}
shareAction={this.props.showComponent.bind(this,componentNames.APP_SHARING)}
helpAction={this.props.toggleComponent.bind(this,componentNames.SIDE_PANEL_HELP)} />
: null }
{ this.props.activeDialog === 'layoutScratch' ? this.getSettingsModal('layout') : null }
{ this.props.activeDialog === 'betaMessage' ? this.getSettingsModal('betaMessage') : null }
{ this.props.activeDialog === 'itemNameScratch' ? this.getSettingsModal('itemNames') : null }
{ this.props.activeDialog === 'savingFromScratch' ? : null }
</div>
removes.forEach((component) => {
switch (component) {
case componentNames.INTRO:
this.hideIntro(options);
if (this.visibleComponents.indexOf(componentNames.MAP) < 0 && this.visibleComponents.indexOf(componentNames.GALLERY) < 0 ) {
if (isMobile) {
AppActions.showComponent(componentNames.MAP);
} else {
AppActions.showComponent([componentNames.MAP,componentNames.GALLERY]);
}
}
break;
}
});
} else if (isMobile && visibleComponents.indexOf(componentNames.MAP) >= 0 && visibleComponents.indexOf(componentNames.GALLERY) >= 0) {
switch (component) {
case componentNames.INTRO:
this.showIntro(options);
MapActions.selectFeature(false);
AppActions.hideComponent([componentNames.MAP,componentNames.GALLERY,componentNames.SELECTED_SHARES]);
break;
case componentNames.MAP:
this.showMap(options);
AppActions.hideComponent([componentNames.INTRO,componentNames.GALLERY]);
break;
case componentNames.GALLERY:
if (this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
this.showGallery(options);
AppActions.hideComponent([componentNames.INTRO,componentNames.MAP]);
} else {
AppActions.hideComponent(componentNames.GALLERY);
}
break;
}
});
removes.forEach((component) => {
switch (component) {
case componentNames.INTRO:
this.hideIntro(options);
if (this.visibleComponents.indexOf(componentNames.MAP) < 0 && this.visibleComponents.indexOf(componentNames.GALLERY) < 0 ) {
AppActions.showComponent(componentNames.MAP);
}
break;
}
});
}
switch (component) {
case componentNames.INTRO:
this.showIntro(options);
MapActions.selectFeature(false);
AppActions.hideComponent([componentNames.MAP,componentNames.GALLERY,componentNames.SELECTED_SHARES]);
break;
case componentNames.MAP:
this.showMap(options);
const hideComponents = [componentNames.INTRO];
const showComponents = [];
if (isMobile) {
hideComponents.push(componentNames.GALLERY);
} else {
showComponents.push(componentNames.GALLERY);
}
AppActions.hideComponent(hideComponents);
if (showComponents.length > 0) {
AppActions.showComponent(showComponents);
}
break;
case componentNames.GALLERY:
if (this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
this.showGallery(options);
const hideComponents = [componentNames.INTRO];
const showComponents = [];
if (isMobile) {
hideComponents.push(componentNames.MAP);
} else {
showComponents.push(componentNames.MAP);
removes.forEach((component) => {
switch (component) {
case componentNames.INTRO:
this.hideIntro(options);
if (this.visibleComponents.indexOf(componentNames.MAP) < 0 && this.visibleComponents.indexOf(componentNames.GALLERY) < 0 ) {
if (isMobile) {
AppActions.showComponent(componentNames.MAP);
} else {
AppActions.showComponent([componentNames.MAP,componentNames.GALLERY]);
}
}
break;
}
});
} else if (isMobile && visibleComponents.indexOf(componentNames.MAP) >= 0 && visibleComponents.indexOf(componentNames.GALLERY) >= 0) {
case componentNames.MAP:
this.showMap(options);
const hideComponents = [componentNames.INTRO];
const showComponents = [];
if (isMobile) {
hideComponents.push(componentNames.GALLERY);
} else {
showComponents.push(componentNames.GALLERY);
}
AppActions.hideComponent(hideComponents);
if (showComponents.length > 0) {
AppActions.showComponent(showComponents);
}
break;
case componentNames.GALLERY:
if (this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
this.showGallery(options);
const hideComponents = [componentNames.INTRO];
const showComponents = [];
if (isMobile) {
hideComponents.push(componentNames.MAP);
} else {
showComponents.push(componentNames.MAP);
}
AppActions.hideComponent(hideComponents);
if (showComponents.length > 0) {
AppActions.showComponent(showComponents);
}
} else {
AppActions.hideComponent(componentNames.GALLERY);