How to use the babel/constants/componentNames/ComponentNames.CONTRIBUTE function in babel

To help you get started, we’ve selected a few babel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Esri / storymap-crowdsource / src / app / controllers / layouts / stacked / StackedController.babel.js View on Github external
checkOverlayComponentVisibility() {
    const featuresInExtent = lang.getObject('appState.app.map.featuresInExtent',false,this);
    const selectedFeatureId = lang.getObject('appState.app.map.selectedFeatureId',false,this);
    const contributing = lang.getObject('appState.app.contributing.active',false,this);

    if (!contributing && selectedFeatureId && featuresInExtent.length > 0 && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) < 0) {
      AppActions.changeComponentsVisibility({show: componentNames.SELECTED_SHARES, hide: componentNames.INTRO});
    } else if (!selectedFeatureId && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) >= 0) {
      AppActions.hideComponent(componentNames.SELECTED_SHARES);
    }

    if (contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
      AppActions.changeComponentsVisibility({show: [componentNames.CONTRIBUTE,componentNames.MAP], hide: [componentNames.INTRO, componentNames.SELECTED_SHARES]});
    } else if (!contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) >= 0) {
      AppActions.hideComponent(componentNames.CONTRIBUTE);
    }
  }
github Esri / storymap-crowdsource / src / app / controllers / layouts / sidePanel / SidePanelController.babel.js View on Github external
checkOverlayComponentVisibility() {
    const featuresInExtent = lang.getObject('appState.app.map.featuresInExtent',false,this);
    const selectedFeatureId = lang.getObject('appState.app.map.selectedFeatureId',false,this);
    const contributing = lang.getObject('appState.app.contributing.active',false,this);

    if (!contributing && selectedFeatureId && featuresInExtent.length > 0 && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) < 0) {
      AppActions.changeComponentsVisibility({show: componentNames.SELECTED_SHARES, hide: componentNames.INTRO});
    } else if (!selectedFeatureId && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) >= 0) {
      AppActions.hideComponent(componentNames.SELECTED_SHARES);
    }

    if (contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
      AppActions.changeComponentsVisibility({show: [componentNames.CONTRIBUTE,componentNames.MAP], hide: [componentNames.INTRO, componentNames.SELECTED_SHARES]});
    } else if (!contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) >= 0) {
      AppActions.hideComponent(componentNames.CONTRIBUTE);
    }
  }
github Esri / storymap-crowdsource / src / app / controllers / layouts / stacked / StackedController.babel.js View on Github external
checkOverlayComponentVisibility() {
    const featuresInExtent = lang.getObject('appState.app.map.featuresInExtent',false,this);
    const selectedFeatureId = lang.getObject('appState.app.map.selectedFeatureId',false,this);
    const contributing = lang.getObject('appState.app.contributing.active',false,this);

    if (!contributing && selectedFeatureId && featuresInExtent.length > 0 && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) < 0) {
      AppActions.changeComponentsVisibility({show: componentNames.SELECTED_SHARES, hide: componentNames.INTRO});
    } else if (!selectedFeatureId && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) >= 0) {
      AppActions.hideComponent(componentNames.SELECTED_SHARES);
    }

    if (contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
      AppActions.changeComponentsVisibility({show: [componentNames.CONTRIBUTE,componentNames.MAP], hide: [componentNames.INTRO, componentNames.SELECTED_SHARES]});
    } else if (!contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) >= 0) {
      AppActions.hideComponent(componentNames.CONTRIBUTE);
    }
  }
github Esri / storymap-crowdsource / src / app / controllers / layouts / sidePanel / SidePanelController.babel.js View on Github external
checkOverlayComponentVisibility() {
    const featuresInExtent = lang.getObject('appState.app.map.featuresInExtent',false,this);
    const selectedFeatureId = lang.getObject('appState.app.map.selectedFeatureId',false,this);
    const contributing = lang.getObject('appState.app.contributing.active',false,this);

    if (!contributing && selectedFeatureId && featuresInExtent.length > 0 && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) < 0) {
      AppActions.changeComponentsVisibility({show: componentNames.SELECTED_SHARES, hide: componentNames.INTRO});
    } else if (!selectedFeatureId && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) >= 0) {
      AppActions.hideComponent(componentNames.SELECTED_SHARES);
    }

    if (contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
      AppActions.changeComponentsVisibility({show: [componentNames.CONTRIBUTE,componentNames.MAP], hide: [componentNames.INTRO, componentNames.SELECTED_SHARES]});
    } else if (!contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) >= 0) {
      AppActions.hideComponent(componentNames.CONTRIBUTE);
    }
  }
github Esri / storymap-crowdsource / src / app / components / crowdsource / viewer / Viewer.babel.js View on Github external
return [
      {
        name: viewerText.mobile.bottomNav.home,
        icon: 'home',
        active: this.props.layout.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0 && this.props.layout.visibleComponents.indexOf(componentNames.INTRO) >= 0,
        action: this.props.showComponent.bind(this,componentNames.INTRO)
      },{
        name: viewerText.mobile.bottomNav.map,
        icon: 'map',
        active: this.props.layout.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0 && this.props.layout.visibleComponents.indexOf(componentNames.MAP) >= 0,
        action: this.props.showComponent.bind(this,componentNames.MAP)
      },{
        name: viewerText.mobile.bottomNav.gallery,
        icon: 'gallery',
        active: this.props.layout.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0 && this.props.layout.visibleComponents.indexOf(componentNames.GALLERY) >= 0,
        action: this.props.showComponent.bind(this,componentNames.GALLERY)
      }
    ];
  }
github Esri / storymap-crowdsource / src / app / controllers / layouts / stacked / StackedController.babel.js View on Github external
checkOverlayComponentVisibility() {
    const featuresInExtent = lang.getObject('appState.app.map.featuresInExtent',false,this);
    const selectedFeatureId = lang.getObject('appState.app.map.selectedFeatureId',false,this);
    const contributing = lang.getObject('appState.app.contributing.active',false,this);

    if (!contributing && selectedFeatureId && featuresInExtent.length > 0 && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) < 0) {
      AppActions.changeComponentsVisibility({show: componentNames.SELECTED_SHARES, hide: componentNames.INTRO});
    } else if (!selectedFeatureId && this.visibleComponents.indexOf(componentNames.SELECTED_SHARES) >= 0) {
      AppActions.hideComponent(componentNames.SELECTED_SHARES);
    }

    if (contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) < 0) {
      AppActions.changeComponentsVisibility({show: [componentNames.CONTRIBUTE,componentNames.MAP], hide: [componentNames.INTRO, componentNames.SELECTED_SHARES]});
    } else if (!contributing && this.visibleComponents.indexOf(componentNames.CONTRIBUTE) >= 0) {
      AppActions.hideComponent(componentNames.CONTRIBUTE);
    }
  }
github Esri / storymap-crowdsource / src / app / controllers / layouts / sidePanel / SidePanelController.babel.js View on Github external
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);
            }
github Esri / storymap-crowdsource / src / app / components / crowdsource / viewer / Viewer.babel.js View on Github external
<CrowdsourceWebmap showOnTop={this.props.map.forceToTop} mapTips={this.getMapTipProps()} className="content-pane map-pane" controllerOptions={this.webmapControllerOptions} />
              <ThumbnailGallery
                isMobile={this.props.mode.isMobile}
                className="content-pane gallery-pane"
                items={this.props.map.featuresInExtent}
                layer={this.props.map.layer}
                highlighted={this.props.map.highlightedFeatureId}
                selected={this.props.map.selectedFeatureId}
                highlightAction={this.props.highlightAction}
                selectAction={this.props.selectFeature}
                {...this.props.components.gallery}
                {...this.props.components.map.crowdsourceLayer}>
              </ThumbnailGallery>;
            </div>
            <ReactCSSTransitionGroup transitionName="overlay-toggle" transitionEnterTimeout={1000} transitionLeaveTimeout={1000} >
              { this.props.components.contribute.participationAllowed && this.props.layout.visibleComponents.indexOf(componentNames.CONTRIBUTE) >= 0 ? <ContributePanel
                className="overlay-panel"
                loginAction={this.props.loginUser}
                closeAction={this.props.updateContributeState.bind(this,{active: false})}
                saveAction={this.saveContribution}
                socialLogin={this.props.config.allowSocialLogin}
                fieldDefinitions={this.props.map.layer.fields}
                map={this.props.map.originalObject}
                user={this.props.user}
                {...this.props.contributing}
                {...this.props.components.contribute}
                {...this.props.components.map.crowdsourceLayer}>
              </ContributePanel> : null }
              { this.props.layout.visibleComponents.indexOf(componentNames.SELECTED_SHARES) >= 0 && this.getFeatureFromId(lang.getObject('props.map.selectedFeatureId',false,this)) ? <SelectedShares
                className="overlay-panel"
                featuresInExtent={this.props.map.featuresInExtent}
                feature={this.getFeatureFromId(lang.getObject('props.map.selectedFeatureId',false,this))}