add backup link to profile editor

This commit is contained in:
hzrd149 2023-04-10 08:18:27 -05:00
parent 88f34c1e40
commit c6a4f96cd3
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"nostrudel": minor
---
Add "Download Backup" link to profile edit view

View File

@ -6,6 +6,7 @@ import {
FormErrorMessage,
FormLabel,
Input,
Link,
Textarea,
useToast,
} from "@chakra-ui/react";
@ -13,6 +14,7 @@ import moment from "moment";
import { useEffect, useMemo } from "react";
import { useForm } from "react-hook-form";
import { nostrPostAction } from "../../classes/nostr-post-action";
import { ExternalLinkIcon } from "../../components/icons";
import { isLNURL } from "../../helpers/lnurl";
import { Kind0ParsedContent } from "../../helpers/user-metadata";
import { useReadRelayUrls, useWriteRelayUrls } from "../../hooks/use-client-relays";
@ -169,6 +171,9 @@ const MetadataForm = ({ defaultValues, onSubmit }: MetadataFormProps) => {
<FormErrorMessage>{errors.lightningAddress?.message}</FormErrorMessage>
</FormControl>
<Flex alignSelf="flex-end" gap="2">
<Button as={Link} isExternal href="https://metadata.nostr.com/" rightIcon={<ExternalLinkIcon />}>
Download Backup
</Button>
<Button onClick={() => reset()}>Reset</Button>
<Button colorScheme="brand" isLoading={isSubmitting} type="submit">
Update