fix
Some checks are pending
Docker image / build-and-push-image (push) Waiting to run

This commit is contained in:
Your Name 2024-09-19 13:40:22 -06:00
parent d5314d84f8
commit e00131ee4f

View File

@ -1,7 +1,7 @@
import { useState } from "react"; import { useState } from "react";
import { Button, ButtonGroup, Divider, Flex, IconButton, Link, Spinner, Text, useToast } from "@chakra-ui/react"; import { Button, ButtonGroup, Divider, Flex, IconButton, Link, Spinner, Text, useToast } from "@chakra-ui/react";
import { Link as RouterLink, useLocation } from "react-router-dom"; import { Link as RouterLink, useLocation } from "react-router-dom";
import clientRelaysService, { recommendedReadRelays, recommendedWriteRelays } from "../../services/client-relays";
import Key01 from "../../components/icons/key-01"; import Key01 from "../../components/icons/key-01";
import Diamond01 from "../../components/icons/diamond-01"; import Diamond01 from "../../components/icons/diamond-01";
import UsbFlashDrive from "../../components/icons/usb-flash-drive"; import UsbFlashDrive from "../../components/icons/usb-flash-drive";
@ -19,7 +19,9 @@ import SerialPortSigner from "../../classes/signers/serial-port-signer";
import ExtensionAccount from "../../classes/accounts/extension-account"; import ExtensionAccount from "../../classes/accounts/extension-account";
import SerialPortAccount from "../../classes/accounts/serial-port-account"; import SerialPortAccount from "../../classes/accounts/serial-port-account";
import AmberAccount from "../../classes/accounts/amber-account"; import AmberAccount from "../../classes/accounts/amber-account";
import clientRelaysService, { recommendedReadRelays, recommendedWriteRelays } from "../../services/client-relays";
import { getRelaysFromExt } from "../../helpers/nip07"; import { getRelaysFromExt } from "../../helpers/nip07";
export default function LoginStartView() { export default function LoginStartView() {
const location = useLocation(); const location = useLocation();
const toast = useToast(); const toast = useToast();
@ -78,7 +80,7 @@ export default function LoginStartView() {
{window.nostr && ( {window.nostr && (
<Button <Button
onClick={async () => { onClick={async () => {
signinWithExtension(); signinWithExtension();
const { read, write } = await getRelaysFromExt(); const { read, write } = await getRelaysFromExt();
clientRelaysService.readRelays.next(read); clientRelaysService.readRelays.next(read);
clientRelaysService.writeRelays.next(write); clientRelaysService.writeRelays.next(write);
@ -87,6 +89,9 @@ export default function LoginStartView() {
Extension Extension
</Button> </Button>
)} )}
<Button as={RouterLink} to="./address" state={location.state} w="full" colorScheme="blue" leftIcon={<AtIcon />}>
Nostr Address
</Button>
{SerialPortSigner.SUPPORTED && ( {SerialPortSigner.SUPPORTED && (
<ButtonGroup colorScheme="purple"> <ButtonGroup colorScheme="purple">
<Button onClick={signinWithSerial} leftIcon={<UsbFlashDrive boxSize={6} />} w="xs"> <Button onClick={signinWithSerial} leftIcon={<UsbFlashDrive boxSize={6} />} w="xs">
@ -104,17 +109,10 @@ export default function LoginStartView() {
)} )}
{AmberSigner.SUPPORTED && ( {AmberSigner.SUPPORTED && (
<ButtonGroup colorScheme="orange" w="full"> <ButtonGroup colorScheme="orange" w="full">
<Button <Button onClick={signinWithAmber} leftIcon={<Diamond01 boxSize={6} />} flex={1}>
onClick={async () => { Use Amber
const { read, write } = await getRelaysFromExt(); </Button>
clientRelaysService.readRelays.next(read); <IconButton
clientRelaysService.writeRelays.next(write);
clientRelaysService.saveRelays();
}}
>
Extension
</Button>
<IconButton
as={Link} as={Link}
aria-label="What is Amber?" aria-label="What is Amber?"
title="What is Amber?" title="What is Amber?"
@ -124,7 +122,48 @@ export default function LoginStartView() {
/> />
</ButtonGroup> </ButtonGroup>
)} )}
<Flex w="full" alignItems="center" gap="4">
<Divider />
<Text fontWeight="bold">OR</Text>
<Divider />
</Flex>
<Flex gap="2"> <Flex gap="2">
<Button
flexDirection="column"
h="auto"
p="4"
as={RouterLink}
to="./nostr-connect"
state={location.state}
variant="outline"
>
<Package boxSize={12} />
Nostr Connect
</Button>
<Button
flexDirection="column"
h="auto"
p="4"
as={RouterLink}
to="./nsec"
state={location.state}
variant="outline"
>
<Key01 boxSize={12} />
Private key
</Button>
<Button
flexDirection="column"
h="auto"
p="4"
as={RouterLink}
to="./npub"
state={location.state}
variant="outline"
>
<Eye boxSize={12} />
Public key
</Button>
</Flex> </Flex>
<Text fontWeight="bold" mt="4"> <Text fontWeight="bold" mt="4">
Don't have an account? Don't have an account?