feat: polish

This commit is contained in:
2024-01-19 08:24:13 +07:00
parent 16efd495a0
commit f65175f11e
10 changed files with 114 additions and 27 deletions

View File

@@ -2,10 +2,9 @@ import { MentionNote, User, useArk } from "@lume/ark";
import { LoaderIcon, TrashIcon } from "@lume/icons";
import { useStorage } from "@lume/storage";
import { NDKCacheUserProfile } from "@lume/types";
import { cn, editorValueAtom } from "@lume/utils";
import { cn } from "@lume/utils";
import { NDKEvent, NDKKind } from "@nostr-dev-kit/ndk";
import { Portal } from "@radix-ui/react-dropdown-menu";
import { useAtom } from "jotai";
import { useEffect, useRef, useState } from "react";
import {
Descendant,
@@ -193,7 +192,12 @@ export function ReplyForm({
const storage = useStorage();
const ref = useRef<HTMLDivElement | null>();
const [editorValue, setEditorValue] = useAtom(editorValueAtom);
const [editorValue, setEditorValue] = useState([
{
type: "paragraph",
children: [{ text: "" }],
},
]);
const [contacts, setContacts] = useState<NDKCacheUserProfile[]>([]);
const [target, setTarget] = useState<Range | undefined>();
const [index, setIndex] = useState(0);

View File

@@ -218,7 +218,6 @@ export function OnboardingFollowScreen() {
</>
)}
</button>
UU
</div>
</div>
))

View File

@@ -23,7 +23,7 @@ export function OnboardingProfileSettingsScreen() {
const { register, handleSubmit } = useForm();
const svgURI = `data:image/svg+xml;utf8,${encodeURIComponent(
minidenticon("lume new account", 90, 50),
minidenticon(ark.account.pubkey, 90, 50),
)}`;
const onSubmit = async (data: { name: string; about: string }) => {
@@ -39,7 +39,7 @@ export function OnboardingProfileSettingsScreen() {
const profile: NDKUserProfile = {
...data,
lud16: oldProfile?.lud16 || "",
lud16: "", // temporary remove lud16
nip05: oldProfile?.nip05 || "",
display_name: data.name,
bio: data.about,
@@ -56,9 +56,10 @@ export function OnboardingProfileSettingsScreen() {
if (publish) {
// invalid cache
await storage.clearProfileCache(ark.account.pubkey);
await queryClient.setQueryData(["user", ark.account.pubkey], () => {
return profile;
});
await queryClient.setQueryData(
["user", ark.account.pubkey],
() => profile,
);
setLoading(false);
navigate("/follow");