react-device-detect#isChrome JavaScript Examples

The following examples show how to use react-device-detect#isChrome. 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.js    From virtualdojo-rooms with GNU General Public License v3.0 5 votes vote down vote up
function App() {
  const {
    currentUser,
    event,
    isLoading,
    error,
    isInitializing,
    forcedView,
  } = useContext(store);
  const { palette } = useTheme();
  const theme = {
    container: {
      background: palette.primary.main,
      width: "100%",
      height: "100vh",
    },
  };

  if (isInitializing || isLoading)
    return (
      <div
        style={{
          ...theme.container,
          display: "flex",
          justifyContent: "center",
          alignItems: "center",
          flexDirection: "column",
        }}
      >
        <Typography
          variant="h3"
          color="secondary"
          style={{ marginBottom: "80px" }}
        >
          VirtualDojo Rooms
        </Typography>
        <Typography
          variant="h6"
          color="secondary"
          style={{ marginBottom: "80px" }}
        >
          {isInitializing ? "Authentication..." : "Loading Event..."}
        </Typography>
        {error && <ErrorMessage errorCode={error}></ErrorMessage>}
      </div>
    );
  if ((isMobile || !isChrome) && !forcedView) {
    return <UnsupportedCheck />;
  }
  if (event && currentUser) {
    return (
      <div style={theme.container}>
        <Event user={currentUser} event={event} />
      </div>
    );
  } else if (event) {
    return (
      <div style={theme.container}>
        <JoinEvent />
      </div>
    );
  }
  return (
    <div style={theme.container}>
      <CreateEvent />
    </div>
  );
}