This commit is contained in:
Ren Amamiya
2023-10-04 14:11:45 +07:00
parent 480580890e
commit f80dd78a8e
14 changed files with 165 additions and 176 deletions
+6 -8
View File
@@ -3,16 +3,13 @@ import { useQuery } from '@tanstack/react-query';
import { useCallback } from 'react';
import { Outlet } from 'react-router-dom';
import { ChatListItem } from '@app/chats/components/item';
import { useStorage } from '@libs/storage/provider';
import { ChatListItem } from '@app/chats/components/chaListItem';
import { LoaderIcon } from '@shared/icons';
import { useNostr } from '@utils/hooks/useNostr';
export function ChatsScreen() {
const { db } = useStorage();
const { getAllNIP04Chats } = useNostr();
const { status, data } = useQuery(
['nip04-chats'],
@@ -24,9 +21,7 @@ export function ChatsScreen() {
const renderItem = useCallback(
(event: NDKEvent) => {
if (db.account.pubkey !== event.pubkey) {
return <ChatListItem key={event.id} event={event} />;
}
return <ChatListItem key={event.id} event={event} />;
},
[data]
);
@@ -34,7 +29,10 @@ export function ChatsScreen() {
return (
<div className="grid h-full w-full grid-cols-3">
<div className="scrollbar-hide col-span-1 h-full overflow-y-auto border-r border-white/5">
<div className="h-16 w-full shrink-0 border-b border-white/5" />
<div
data-tauri-drag-region
className="h-16 w-full shrink-0 border-b border-white/5"
/>
<div className="flex h-full flex-col gap-1 py-2">
{status === 'loading' ? (
<div className="flex h-full w-full items-center justify-center pb-16">