import React, { useState } from "react"; import { AnchorButton, Button, MenuItem, Tooltip, Popover, Menu, Elevation, PopoverPosition, Checkbox, Card, } from "@blueprintjs/core"; import { IconNames } from "@blueprintjs/icons"; import * as globals from "../../globals"; // @ts-expect-error ts-migrate(2307) FIXME: Cannot find module './menubar.css' or its correspo... Remove this comment to see the full error message import styles from "./menubar.css"; import { storageGet, storageSet, KEYS } from "../util/localStorage"; const BASE_EMOJI = [0x1f9d1, 0x1f468, 0x1f469]; const SKIN_TONES = [0x1f3fb, 0x1f3fc, 0x1f3fd, 0x1f3fe, 0x1f3ff]; const MICROSCOPE = 0x1f52c; const ZERO_WIDTH_JOINER = 0x0200d; const LOGIN_PROMPT_OFF = "off"; const Auth = React.memo((props) => { const [isPromptOpen, setIsPromptOpen] = useState(shouldShowPrompt()); // @ts-expect-error ts-migrate(2339) FIXME: Property 'auth' does not exist on type '{ children... Remove this comment to see the full error message const { auth, userInfo } = props; const isAuthenticated = userInfo && userInfo.is_authenticated; (window as any).userInfo = userInfo; const randomInt = Math.random() * 15; const sexIndex = Math.floor(randomInt / 5); const skinToneIndex = Math.floor(randomInt % 5); const scientist = String.fromCodePoint( BASE_EMOJI[sexIndex], SKIN_TONES[skinToneIndex], ZERO_WIDTH_JOINER, MICROSCOPE ); if (!shouldShowAuth()) return null; if (isAuthenticated) { const PopoverContent = ( ); return ( ); } const LoginButton = ( Log In ); if (isPromptOpen) { return ( } onInteraction={setIsPromptOpen} > {LoginButton} ); } return LoginButton; function shouldShowAuth() { return auth && auth.requires_client_login; } function shouldShowPrompt() { if (storageGet(KEYS.LOGIN_PROMPT) === LOGIN_PROMPT_OFF) return false; // @ts-expect-error ts-migrate(2774) FIXME: This condition will always return true since the f... Remove this comment to see the full error message return shouldShowAuth && !isAuthenticated; } }); function PromptContent({ setIsPromptOpen }: any) { const [isChecked, setIsChecked] = useState(false); function handleOKClick() { if (isChecked) { storageSet(KEYS.LOGIN_PROMPT, LOGIN_PROMPT_OFF); } setIsPromptOpen(false); } function handleCheckboxChange() { setIsChecked(!isChecked); } return (

Logging in will enable you to create your own categories and labels. Logging in later will reset cellxgene to the default view and cause you to lose progress.

Do not show me this message again
); } export default Auth;