-
-
-
- {followed ? (
-
- ) : (
-
- )}
-
- Message
-
+
+
+
+
+
-
-
-
-
- {user?.name ||
- user?.display_name ||
- user?.displayName ||
- "Anon"}
-
- {user?.nip05 ? (
-
+
+
+
- ) : (
-
- {displayNpub(id, 16)}
-
- )}
-
-
- {user?.about}
+
+
-
-
+
+
Latest posts
diff --git a/packages/ui/src/layouts/settings.tsx b/packages/ui/src/layouts/settings.tsx
index db8cfaee2..aaf9df401 100644
--- a/packages/ui/src/layouts/settings.tsx
+++ b/packages/ui/src/layouts/settings.tsx
@@ -1,6 +1,8 @@
import {
AdvancedSettingsIcon,
InfoIcon,
+ NwcFilledIcon,
+ NwcIcon,
SecureIcon,
SettingsIcon,
UserIcon,
@@ -25,7 +27,7 @@ export function SettingsLayout() {
)
}
>
-
+
User
-
+
General
+
+ twMerge(
+ "flex w-20 shrink-0 flex-col items-center justify-center rounded-lg px-2 py-2 text-neutral-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-900",
+ isActive
+ ? "bg-neutral-100 text-blue-500 hover:bg-neutral-100 dark:bg-neutral-950 dark:hover:bg-neutral-900"
+ : "",
+ )
+ }
+ >
+
+ Wallet
+
@@ -53,7 +69,7 @@ export function SettingsLayout() {
)
}
>
-
+
Backup
-
+
Advanced
-
+
About
diff --git a/packages/ui/src/navigation.tsx b/packages/ui/src/navigation.tsx
index 7192aab99..28da9d2a9 100644
--- a/packages/ui/src/navigation.tsx
+++ b/packages/ui/src/navigation.tsx
@@ -7,9 +7,6 @@ import {
DepotIcon,
HomeFilledIcon,
HomeIcon,
- NwcIcon,
- RelayFilledIcon,
- RelayIcon,
SettingsFilledIcon,
SettingsIcon,
} from "@lume/icons";
diff --git a/packages/ui/src/routes/user.tsx b/packages/ui/src/routes/user.tsx
index 3f725ac03..2ff5b49c1 100644
--- a/packages/ui/src/routes/user.tsx
+++ b/packages/ui/src/routes/user.tsx
@@ -1,25 +1,22 @@
-import { RepostNote, TextNote, useArk, useProfile } from "@lume/ark";
+import { RepostNote, TextNote, User, useArk } from "@lume/ark";
import {
ArrowLeftIcon,
ArrowRightCircleIcon,
ArrowRightIcon,
LoaderIcon,
} from "@lume/icons";
-import { FETCH_LIMIT, displayNpub } from "@lume/utils";
+import { FETCH_LIMIT } from "@lume/utils";
import { NDKEvent, NDKKind } from "@nostr-dev-kit/ndk";
import { useInfiniteQuery } from "@tanstack/react-query";
-import { useEffect, useMemo, useState } from "react";
-import { Link, useNavigate, useParams } from "react-router-dom";
-import { toast } from "sonner";
+import { useMemo } from "react";
+import { useNavigate, useParams } from "react-router-dom";
import { WindowVirtualizer } from "virtua";
-import { NIP05 } from "../nip05";
export function UserRoute() {
const ark = useArk();
const navigate = useNavigate();
const { id } = useParams();
- const { user } = useProfile(id);
const { data, hasNextPage, isLoading, isFetchingNextPage, fetchNextPage } =
useInfiniteQuery({
queryKey: ["user-posts", id],
@@ -51,37 +48,11 @@ export function UserRoute() {
refetchOnWindowFocus: false,
});
- const [followed, setFollowed] = useState(false);
-
const allEvents = useMemo(
() => (data ? data.pages.flatMap((page) => page) : []),
[data],
);
- const follow = async (pubkey: string) => {
- try {
- const add = await ark.createContact({ pubkey });
- if (add) {
- setFollowed(true);
- } else {
- toast.success("You already follow this user");
- }
- } catch (error) {
- console.log(error);
- }
- };
-
- const unfollow = async (pubkey: string) => {
- try {
- const remove = await ark.deleteContact({ pubkey });
- if (remove) {
- setFollowed(false);
- }
- } catch (error) {
- console.log(error);
- }
- };
-
const renderItem = (event: NDKEvent) => {
switch (event.kind) {
case NDKKind.Text:
@@ -93,12 +64,6 @@ export function UserRoute() {
}
};
- useEffect(() => {
- if (ark.account.contacts.includes(id)) {
- setFollowed(true);
- }
- }, []);
-
return (
@@ -119,66 +84,27 @@ export function UserRoute() {
-
-
-
-
- {followed ? (
-
- ) : (
-
- )}
-
- Message
-
+
+
+
+
+
-
-
-
-
- {user?.name ||
- user?.display_name ||
- user?.displayName ||
- "Anon"}
-
- {user?.nip05 ? (
-
+
+
+
- ) : (
-
- {displayNpub(id, 16)}
-
- )}
-
-
- {user?.about}
+
+
-
-
+
+
Latest posts
diff --git a/packages/utils/src/state.ts b/packages/utils/src/state.ts
index e2c8c3400..a280667c8 100644
--- a/packages/utils/src/state.ts
+++ b/packages/utils/src/state.ts
@@ -1,4 +1,5 @@
import { atom } from "jotai";
+import { atomWithStorage } from "jotai/utils";
// Editor
export const editorAtom = atom(false);
@@ -17,4 +18,4 @@ export const activityAtom = atom(false);
export const activityUnreadAtom = atom(0);
// Tutorial
-export const tutorialAtom = atom(true);
+export const tutorialAtom = atomWithStorage("tutorial", true);