This commit is contained in:
Ren Amamiya
2023-07-02 15:12:07 +07:00
parent 8a92813211
commit d35c64e28d
20 changed files with 589 additions and 88 deletions

View File

@@ -12,9 +12,7 @@ export function ChatsListItem({ data }: { data: any }) {
return (
<div className="inline-flex h-9 items-center gap-2.5 rounded-md px-2.5">
<div className="relative h-6 w-6 shrink-0 animate-pulse rounded bg-zinc-800" />
<div>
<div className="h-2.5 w-2/3 animate-pulse truncate rounded bg-zinc-800 text-base font-medium" />
</div>
<div className="h-2.5 w-2/3 animate-pulse rounded bg-zinc-800" />
</div>
);
}
@@ -40,10 +38,10 @@ export function ChatsListItem({ data }: { data: any }) {
</div>
<div className="w-full inline-flex items-center justify-between">
<div className="inline-flex items-baseline gap-1">
<h5 className="max-w-[9rem] truncate font-medium text-zinc-200">
<h5 className="max-w-[10rem] truncate font-medium text-zinc-200">
{user?.nip05 ||
user?.displayName ||
user?.name ||
user?.displayName ||
shortenKey(data.sender_pubkey)}
</h5>
</div>

View File

@@ -0,0 +1,7 @@
export function AccountSettingsScreen() {
return (
<div className="w-full h-full flex items-center justify-center">
<h1>Account</h1>
</div>
);
}

View File

@@ -0,0 +1,7 @@
export function GeneralSettingsScreen() {
return (
<div className="w-full h-full flex items-center justify-center">
<h1>General</h1>
</div>
);
}

View File

@@ -0,0 +1,7 @@
export function ShortcutsSettingsScreen() {
return (
<div className="w-full h-full flex items-center justify-center">
<h1>Shortcuts</h1>
</div>
);
}

View File

@@ -0,0 +1,7 @@
export function UpdateSettingsScreen() {
return (
<div className="w-full h-full flex items-center justify-center">
<h1>Update</h1>
</div>
);
}

View File

@@ -1,19 +1,32 @@
import { getNotesByPubkey } from "@libs/storage";
import { NDKFilter } from "@nostr-dev-kit/ndk";
import { Note } from "@shared/notes/note";
import { RelayContext } from "@shared/relayProvider";
import { useQuery } from "@tanstack/react-query";
import { dateToUnix, getHourAgo } from "@utils/date";
import { LumeEvent } from "@utils/types";
import { useContext } from "react";
export function UserFeed({ pubkey }: { pubkey: string }) {
const ndk = useContext(RelayContext);
const { status, data } = useQuery(["user-feed", pubkey], async () => {
return await getNotesByPubkey(pubkey);
const now = new Date();
const filter: NDKFilter = {
kinds: [1],
authors: [pubkey],
since: dateToUnix(getHourAgo(48, now)),
};
const events = await ndk.fetchEvents(filter);
return [...events];
});
return (
<div className="w-full max-w-[400px] px-2">
<div className="w-full max-w-[400px] px-2 pb-10">
{status === "loading" ? (
<p>Loading...</p>
<div className="px-3">
<p>Loading...</p>
</div>
) : (
data.map((note: LumeEvent) => <Note key={note.event_id} event={note} />)
data.map((note: LumeEvent) => <Note key={note.id} event={note} />)
)}
</div>
);

View File

@@ -145,7 +145,7 @@ export function UserScreen() {
} font-medium inline-flex items-center gap-2 h-10 border-t`}
>
<ThreadsIcon className="w-4 h-4" />
Posts
Activities from 48 hours ago
</button>
)}
</Tab>