import { goToAtom, hasExtensionAtom, submitNostrExtensionAtom } from '@/atoms/signin.atoms' import { Button } from '@/components/ui/Button/Button' import { ListItem } from '@/components/ui/ListItem/ListItem' import { Stack } from '@/components/ui/Stack/Stack' import { Text } from '@/components/ui/Text/Text' import { useGoBack } from '@/hooks/useNavigations' import { duration } from '@/themes/duration.stylex' import { palette } from '@/themes/palette.stylex' import { spacing } from '@/themes/spacing.stylex' import { IconChevronRight, IconExternalLink, IconEye } from '@tabler/icons-react' import { useNavigate } from '@tanstack/react-router' import { useAtomValue, useSetAtom } from 'jotai' import { NstartModal } from 'nstart-modal' import { css } from 'react-strict-dom' import { ContentLink } from '../Content/Link/Link' import { SignInHeader } from './SignInHeader' export const SignInSelect = () => { const goBack = useGoBack() const navigate = useNavigate() const goTo = useSetAtom(goToAtom) const submitWithExtension = useSetAtom(submitNostrExtensionAtom) const hasExtension = useAtomValue(hasExtensionAtom) const handleSignUpClick = () => { const wizard = new NstartModal({ baseUrl: 'https://start.njump.me', an: 'Nosotros', // appName afb: true, // skipBunker asb: false, // skipBunker aan: true, // avoidNsec aac: false, // avoidNcryptsec arr: ['wss://nos.lol', 'wss://nostr.mom', 'wss://relay.damus.io'], awr: ['wss://nos.lol', 'wss://nostr.mom', 'wss://relay.damus.io'], onComplete: async () => { navigate({ to: '/', search: {}, replace: true }) }, }) wizard.open() } return ( <> Choose a sign in method goTo('READ_ONLY')} supportingText='Sign In with any npub, nprofile or a nostr address in read-only mode' trailingIcon={} sx={styles.item}> Read only { if (hasExtension) { try { await submitWithExtension() goBack() return } catch { // fall through to extension page } } goTo('NOSTR_EXTENSION') }} supportingText='Sign in using a compatible browser extension' trailingIcon={} sx={styles.item}> Nostr extension goTo('REMOTE_SIGN')} supportingText='Your private key is managed by a separate application that authorizes actions without direct exposure' trailingIcon={} sx={styles.item}> Remote signer nsec is not supported, it's not recommended to put your nsec in any app or website, choose a nostr signer app } sx={styles.item}> Private Key (nsec) 🙅 Don't have an account yet? ) } const styles = css.create({ root: { height: '100%', }, content: { padding: spacing.padding2, paddingTop: spacing['padding0.5'], }, list: { width: '100%', }, link: { width: '100%', }, item: { width: '100%', paddingBlock: spacing.padding1, minHeight: 72, transitionProperty: 'background-color', transitionDuration: duration.short2, backgroundColor: { ':hover': palette.surfaceContainerHighest, default: palette.surfaceContainerHigh, }, }, button: { height: 60, }, label: { alignItems: 'center', }, })