@patternfly/react-core#PageSidebar JavaScript Examples

The following examples show how to use @patternfly/react-core#PageSidebar. 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: ibutsu-page.js    From ibutsu-server with MIT License 6 votes vote down vote up
render() {
    document.title = this.props.title || 'Ibutsu';
    return (
      <React.Fragment>
        <AlertGroup isToast>
          {this.state.notifications.map((notification) => (
            <Alert key={notification.key} variant={notification.type} title={notification.title} actionLinks={notification.action} isLiveRegion>
              {notification.message}
            </Alert>
          ))}
        </AlertGroup>
        <Page header={<IbutsuHeader eventEmitter={this.props.eventEmitter} version={this.state.version} />} sidebar={<PageSidebar nav={this.props.navigation} theme="dark" />} isManagedSidebar={true} style={{position: "relative"}}>
          {this.props.children}
        </Page>
      </React.Fragment>
    );
  }
Example #2
Source File: NavSidebar.js    From operate-first.github.io-old with GNU General Public License v3.0 5 votes vote down vote up
NavSidebar = ({ isNavOpen, location }) => {
  const navData = useStaticQuery(
    graphql`
      {
        navData {
          navItems {
            id
            label
            href
            links {
              id
              label
              remote
              href
            }
          }
        }
      }
    `
  ).navData.navItems;

  // No Sidebar for mainpage
  if (location.pathname === '/') {
    return <div />;
  }

  return (
    <PageSidebar
      isNavOpen={isNavOpen}
      nav={
        <Nav className="nav" theme="dark" aria-label="Nav">
          <NavList>
            {location &&
              navData.map((node) => <NavGroup key={node.id} {...node} location={location} />)}
          </NavList>
        </Nav>
      }
      theme="dark"
    />
  );
}