components#Sidebar JavaScript Examples

The following examples show how to use components#Sidebar. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: App.jsx    From crypto-manager with MIT License 6 votes vote down vote up
render() {
    const { classes, ...rest } = this.props;
    return (
      <div className={classes.wrapper}>
        <Sidebar
          routes={appRoutes}
          logoText={"Crypto Manager"}
          logo={logo}
          image={image}
          handleDrawerToggle={this.handleDrawerToggle}
          open={this.state.mobileOpen}
          color="blue"
          {...rest}
        />
        <div className={classes.mainPanel} ref="mainPanel">
          <Header
            routes={appRoutes}
            handleDrawerToggle={this.handleDrawerToggle}
            {...rest}
          />

          {this.getRoute() ? (
            <div className={classes.content}>
              <div className={classes.container}>{switchRoutes}</div>
            </div>
          ) : (
            <div className={classes.map}>{switchRoutes}</div>
          )}
          {this.getRoute() ? <Footer /> : null}
        </div>
      </div>
    );
  }
Example #2
Source File: AppMain.jsx    From crypto-manager with MIT License 5 votes vote down vote up
render() {
    const { classes, ...rest } = this.props;
    const path = this.props.location.pathname;
    return (
      <div>
        {
          path === "/signup" || path === "/login" ?
            <div className={classes.content}>
              <div className={classes.container}>{switchRoutes}</div>
            </div> :
            <div className={classes.wrapper}>
              <Sidebar
                routes={navRoutes}
                logoText={"Crypto Manager"}
                logo={logo}
                image={image}
                handleDrawerToggle={this.handleDrawerToggle}
                open={this.state.mobileOpen}
                color="blue"
                {...rest}
              />
              <div className={classes.mainPanel} ref="mainPanel">
                <Header
                  routes={navRoutes}
                  handleDrawerToggle={this.handleDrawerToggle}
                  {...rest}
                />

                {this.getRoute() ? (
                  <div className={classes.content}>
                    <div className={classes.container}>{switchRoutes}</div>
                  </div>
                ) : (
                  <div className={classes.map}>{switchRoutes}</div>
                )}
                {this.getRoute() ? <Footer /> : null}
              </div>
            </div>
        }
      </div>
    );
  }
Example #3
Source File: app.jsx    From apps with GNU Affero General Public License v3.0 5 votes vote down vote up
renderFull(Component, props) {
        const { menu, settings, title } = this.props;
        const { sidebarActive } = this.state;
        const { route } = this.props;

        const mainMenu = new Map(menu.get('main'));
        const navMenu = new Map([]);

        // we add the normal "nav" menu entries...
        menu.get('nav').forEach((v, k) => navMenu.set(k, v));

        const content = (
            <div className="bulma-container">
                <Component {...props} route={route} />
            </div>
        );
        const sidebar = (
            <Sidebar
                active={sidebarActive}
                collapsed={true}
                mainMenu={mainMenu}
                navMenu={navMenu}
            >
                <Menu menu={mainMenu} onToggle={this.handleSidebarToggle} />
                <Menu
                    menu={navMenu}
                    onToggle={this.handleSidebarToggle}
                    mobileOnly
                />
            </Sidebar>
        );
        return (
            <Fragment>
                <TopNavbar
                    active={sidebarActive}
                    menu={navMenu}
                    settings={settings}
                    title={title}
                    onToggle={this.handleSidebarToggle}
                />
                <SidebarContainer
                    active={true}
                    sidebar={sidebar}
                    content={content}
                />
            </Fragment>
        );
    }