react-device-detect#isMobileOnly TypeScript Examples

The following examples show how to use react-device-detect#isMobileOnly. 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: MainLayout.tsx    From amplication with Apache License 2.0 6 votes vote down vote up
function MainLayout({ children, footer, className }: Props) {
  return (
    <div
      className={classNames(CLASS_NAME, className, {
        [`${CLASS_NAME}--mobile`]: isMobileOnly,
      })}
    >
      <div className={`${CLASS_NAME}__wrapper`}>{children}</div>
      {footer && <div className={`${CLASS_NAME}__footer`}>{footer}</div>}
    </div>
  );
}
Example #2
Source File: WorkspaceLayout.tsx    From amplication with Apache License 2.0 5 votes vote down vote up
function WorkspaceLayout({ match }: Props) {
  if (isMobileOnly) {
    return <MobileMessage />;
  }

  return (
    <MainLayout className={CLASS_NAME}>
      <MainLayout.Menu>
        <MenuItemWithFixedPanel
          tooltip=""
          icon={false}
          isOpen
          panelKey={"panelKey"}
          onClick={() => {}}
        >
          <WorkspaceSelector />
          <div className={`${CLASS_NAME}__tabs`}>
            <InnerTabLink to={`/`} icon="grid">
              Apps
            </InnerTabLink>
            <InnerTabLink to={`/workspace/settings`} icon="settings">
              Workspace Settings
            </InnerTabLink>
            <InnerTabLink to={`/workspace/members`} icon="users">
              Workspace Members
            </InnerTabLink>
            {/* <InnerTabLink to={`/workspace/plans`} icon="file_text">
              Workspace Plan
            </InnerTabLink> */}
          </div>
        </MenuItemWithFixedPanel>
      </MainLayout.Menu>
      <MainLayout.Content>
        <CompleteInvitation />
        <div className={`${CLASS_NAME}__app-container`}>
          <PageContent className={CLASS_NAME}>
            <Switch>
              <RouteWithAnalytics exact path="/workspace/settings">
                <WorkspaceForm />
              </RouteWithAnalytics>
            </Switch>
            <Switch>
              <RouteWithAnalytics
                exact
                path="/workspace/members"
                component={MemberList}
              />
            </Switch>
            {/* <Switch>
              <RouteWithAnalytics exact path="/workspace/plans" component={Subscription} />
            </Switch> */}
			<Switch>
              <RouteWithAnalytics exact path="/user/profile">
                <ProfilePage />
              </RouteWithAnalytics>
            </Switch>
            <Switch>
              <RouteWithAnalytics exact path="/">
                <ApplicationList />
              </RouteWithAnalytics>
            </Switch>
          </PageContent>
        </div>
      </MainLayout.Content>
      <ScreenResolutionMessage />
    </MainLayout>
  );
}