minor updates
This commit is contained in:
@@ -3,7 +3,7 @@ import { NoteRepost } from "@app/space/components/notes/metadata/repost";
|
||||
import { NoteZap } from "@app/space/components/notes/metadata/zap";
|
||||
import { createReplyNote } from "@libs/storage";
|
||||
import { NDKEvent, NDKFilter } from "@nostr-dev-kit/ndk";
|
||||
import { LoaderIcon, ReplyIcon, RepostIcon } from "@shared/icons";
|
||||
import { LoaderIcon, ReplyIcon, RepostIcon, ZapIcon } from "@shared/icons";
|
||||
import { RelayContext } from "@shared/relayProvider";
|
||||
import { decode } from "light-bolt11-decoder";
|
||||
import { useContext } from "react";
|
||||
@@ -99,17 +99,24 @@ export function NoteMetadata({
|
||||
className="animate-spin text-black dark:text-white"
|
||||
/>
|
||||
</div>
|
||||
<div className="ml-auto">
|
||||
<div className="w-10 h-4 bg-zinc-800 rounded animate-pulse" />
|
||||
<div className="w-20 group inline-flex items-center gap-1.5">
|
||||
<ZapIcon
|
||||
width={16}
|
||||
height={16}
|
||||
className="text-zinc-400 group-hover:text-green-400"
|
||||
/>
|
||||
<LoaderIcon
|
||||
width={16}
|
||||
height={16}
|
||||
className="animate-spin text-black dark:text-white"
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<NoteReply id={id} replies={data.replies} />
|
||||
<NoteRepost id={id} pubkey={eventPubkey} reposts={data.reposts} />
|
||||
<div className="ml-auto">
|
||||
<NoteZap zaps={data.zap} />
|
||||
</div>
|
||||
<NoteZap zaps={data.zap} />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -50,7 +50,7 @@ export function NoteReply({ id, replies }: { id: string; replies: number }) {
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => openModal()}
|
||||
className="w-20 group inline-flex items-center gap-1.5"
|
||||
className="w-14 group inline-flex items-center gap-1.5"
|
||||
>
|
||||
<ReplyIcon
|
||||
width={16}
|
||||
|
||||
@@ -44,7 +44,7 @@ export function NoteRepost({
|
||||
<button
|
||||
type="button"
|
||||
onClick={(e) => submitEvent(e)}
|
||||
className="w-20 group inline-flex items-center gap-1.5"
|
||||
className="w-14 group inline-flex items-center gap-1.5"
|
||||
>
|
||||
<RepostIcon
|
||||
width={16}
|
||||
|
||||
@@ -1,13 +1,22 @@
|
||||
import { ZapIcon } from "@shared/icons";
|
||||
import { compactNumber } from "@utils/number";
|
||||
import { useState } from "react";
|
||||
|
||||
export function NoteZap({ zaps }: { zaps: number }) {
|
||||
const [count, setCount] = useState(zaps);
|
||||
const [count] = useState(zaps);
|
||||
|
||||
return (
|
||||
<button type="button" className="group inline-flex items-center gap-1.5">
|
||||
<button
|
||||
type="button"
|
||||
className="w-14 group inline-flex items-center gap-1.5"
|
||||
>
|
||||
<ZapIcon
|
||||
width={16}
|
||||
height={16}
|
||||
className="text-zinc-400 group-hover:text-blue-400"
|
||||
/>
|
||||
<span className="text-base leading-none text-zinc-400 group-hover:text-white">
|
||||
{compactNumber.format(count)} sats zapped
|
||||
{compactNumber.format(count)}
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
|
||||
21
src/shared/icons/thread.tsx
Normal file
21
src/shared/icons/thread.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { SVGProps } from "react";
|
||||
|
||||
export function ThreadIcon(
|
||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||
) {
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
{...props}
|
||||
>
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M7.5 5.75a1.75 1.75 0 113.5 0 1.75 1.75 0 01-3.5 0zM13 5.75a1.75 1.75 0 113.5 0 1.75 1.75 0 01-3.5 0zM7.5 18.25a1.75 1.75 0 113.5 0 1.75 1.75 0 01-3.5 0zM13 18.25a1.75 1.75 0 113.5 0 1.75 1.75 0 01-3.5 0zM7.5 11.9a1.75 1.75 0 113.5 0v.1a1.75 1.75 0 11-3.5 0v-.1zM13 11.9a1.75 1.75 0 113.5 0v.1a1.75 1.75 0 11-3.5 0v-.1z"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user