From 7b09dc3147e6e0d8e3e6c742c86f25ac8899efda Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Thu, 22 Jun 2023 10:45:45 +0700 Subject: [PATCH] polish --- src/app/channel/components/createModal.tsx | 53 ++++--- src/app/channel/components/item.tsx | 7 +- src/app/chat/components/item.tsx | 11 +- src/app/chat/components/list.tsx | 2 + src/app/chat/components/modal.tsx | 140 ++++++++++++++++++ src/app/chat/components/self.tsx | 11 +- src/app/chat/components/sidebar.tsx | 14 +- src/app/onboarding/pages/index.page.tsx | 10 +- src/app/space/components/blocks/feed.tsx | 16 +- src/app/space/components/blocks/following.tsx | 8 +- src/app/space/components/blocks/image.tsx | 16 +- src/app/space/components/blocks/thread.tsx | 16 +- src/app/trending/components/profile.tsx | 2 +- src/app/trending/components/trendingNotes.tsx | 8 +- .../trending/components/trendingProfiles.tsx | 8 +- src/shared/activeLink.tsx | 5 +- src/shared/image.tsx | 12 +- src/shared/link.tsx | 18 +++ src/shared/navigation.tsx | 6 +- src/shared/notes/mentions/user.tsx | 5 +- src/shared/titleBar.tsx | 27 ++++ src/shared/user.tsx | 9 +- src/utils/parser.tsx | 5 +- 23 files changed, 285 insertions(+), 124 deletions(-) create mode 100644 src/app/chat/components/modal.tsx create mode 100644 src/shared/link.tsx create mode 100644 src/shared/titleBar.tsx diff --git a/src/app/channel/components/createModal.tsx b/src/app/channel/components/createModal.tsx index ca84bce3..7cb2e9c5 100644 --- a/src/app/channel/components/createModal.tsx +++ b/src/app/channel/components/createModal.tsx @@ -2,7 +2,6 @@ import { Dialog, Transition } from "@headlessui/react"; import { createChannel } from "@libs/storage"; import { NDKEvent, NDKPrivateKeySigner } from "@nostr-dev-kit/ndk"; import { AvatarUploader } from "@shared/avatarUploader"; -import { Button } from "@shared/button"; import { CancelIcon, LoaderIcon, PlusIcon } from "@shared/icons"; import { Image } from "@shared/image"; import { RelayContext } from "@shared/relayProvider"; @@ -83,11 +82,11 @@ export function ChannelCreateModal() { onClick={() => openModal()} className="inline-flex h-9 items-center gap-2.5 rounded-md px-2.5" > -
Running Lume, fighting for better future
diff --git a/src/app/space/components/blocks/feed.tsx b/src/app/space/components/blocks/feed.tsx index 418393a9..c0de13cc 100644 --- a/src/app/space/components/blocks/feed.tsx +++ b/src/app/space/components/blocks/feed.tsx @@ -2,6 +2,7 @@ import { getNotesByAuthor } from "@libs/storage"; import { CancelIcon } from "@shared/icons"; import { Note } from "@shared/notes/note"; import { NoteSkeleton } from "@shared/notes/skeleton"; +import { TitleBar } from "@shared/titleBar"; import { useActiveAccount } from "@stores/accounts"; import { useVirtualizer } from "@tanstack/react-virtual"; import { useEffect, useMemo, useRef } from "react"; @@ -56,20 +57,7 @@ export function FeedBlock({ params }: { params: any }) { return (
+
{profile.nip05 || shortenKey(data.pubkey)}
Failed to load...
} {!data ? ( diff --git a/src/app/trending/components/trendingProfiles.tsx b/src/app/trending/components/trendingProfiles.tsx index 4303139b..27030538 100644 --- a/src/app/trending/components/trendingProfiles.tsx +++ b/src/app/trending/components/trendingProfiles.tsx @@ -1,5 +1,6 @@ import { Profile } from "@app/trending/components/profile"; import { NoteSkeleton } from "@shared/notes/skeleton"; +import { TitleBar } from "@shared/titleBar"; import useSWR from "swr"; const fetcher = (url: string) => fetch(url).then((r) => r.json()); @@ -12,12 +13,7 @@ export function TrendingProfiles() { return (Failed to load...
} {!data ? ( diff --git a/src/shared/activeLink.tsx b/src/shared/activeLink.tsx index 8ec3e4ea..ae2e34eb 100644 --- a/src/shared/activeLink.tsx +++ b/src/shared/activeLink.tsx @@ -1,3 +1,4 @@ +import { Link } from "@shared/link"; import { usePageContext } from "@utils/hooks/usePageContext"; import { twMerge } from "tailwind-merge"; @@ -16,11 +17,11 @@ export function ActiveLink({ const pathName = pageContext.urlPathname; return ( - {children} - + ); } diff --git a/src/shared/image.tsx b/src/shared/image.tsx index 77057860..d3d0475d 100644 --- a/src/shared/image.tsx +++ b/src/shared/image.tsx @@ -1,8 +1,14 @@ import { DEFAULT_AVATAR } from "@stores/constants"; +import { ClassAttributes, ImgHTMLAttributes, JSX } from "react"; -export function Image(props) { - const addImageFallback = (event) => { - event.currentTarget.src = DEFAULT_AVATAR; +export function Image( + props: JSX.IntrinsicAttributes & + ClassAttributes