How to use the babel/constants/componentNames/ComponentNames.MAP 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 / sidePanel / SidePanelController.babel.js View on Github external
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);
            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;
github Esri / storymap-crowdsource / src / app / controllers / layouts / sidePanel / SidePanelController.babel.js View on Github external
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) {
github Esri / storymap-crowdsource / src / app / controllers / layouts / stacked / StackedController.babel.js View on Github external
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;
        }

      });
github Esri / storymap-crowdsource / src / app / components / crowdsource / viewer / Viewer.babel.js View on Github external
get mobileNavigationButtons() {
    if (this.props.contributing.active) {
      return false;
    }
    if (this.props.components.contribute.participationAllowed && this.props.loading.map && !this.props.contributing.active) {
      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)
        },{
          name: viewerText.mobile.bottomNav.participate,
          icon: 'participate',
          active: this.props.layout.visibleComponents.indexOf(componentNames.CONTRIBUTE) >= 0,
          action: this.props.updateContributeState.bind(this,{active: true})
        }
      ];
    }

    return [
github Esri / storymap-crowdsource / src / app / controllers / layouts / sidePanel / SidePanelController.babel.js View on Github external
} 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]);
    }

  }
github Esri / storymap-crowdsource / src / app / components / crowdsource / viewer / Viewer.babel.js View on Github external
action: this.props.updateContributeState.bind(this,{active: true})
        }
      ];
    }

    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 / sidePanel / SidePanelController.babel.js View on Github external
} 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);
            }
            break;
        }

      });