From efbf21d505358cdc88fe579938b8186f03818626 Mon Sep 17 00:00:00 2001 From: highperfocused Date: Sun, 5 Oct 2025 17:35:01 +0200 Subject: [PATCH] Refactor ZapButton to use Button component and adjust BlogPostPage button size and styling --- src/components/ZapButton.tsx | 27 +++++++++++++++------------ src/pages/BlogPostPage.tsx | 5 ++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/components/ZapButton.tsx b/src/components/ZapButton.tsx index bb3bbd8..5313a73 100644 --- a/src/components/ZapButton.tsx +++ b/src/components/ZapButton.tsx @@ -5,11 +5,13 @@ import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useAuthor } from '@/hooks/useAuthor'; import { Zap } from 'lucide-react'; import type { Event } from 'nostr-tools'; +import { Button } from './ui/button'; interface ZapButtonProps { target: Event; className?: string; showCount?: boolean; + buttonVariant?: 'default' | 'outline' | 'ghost' | 'link' | 'destructive'; zapData?: { count: number; totalSats: number; isLoading?: boolean }; } @@ -17,6 +19,7 @@ export function ZapButton({ target, className = "text-xs ml-1", showCount = true, + buttonVariant = "outline", zapData: externalZapData }: ZapButtonProps) { const { user } = useCurrentUser(); @@ -41,18 +44,18 @@ export function ZapButton({ return ( -
- - - {showLoading ? ( - '...' - ) : showCount && totalSats > 0 ? ( - `${totalSats.toLocaleString()}` - ) : ( - 'Zap' - )} - -
+
); } \ No newline at end of file diff --git a/src/pages/BlogPostPage.tsx b/src/pages/BlogPostPage.tsx index 796abbd..09d06e0 100644 --- a/src/pages/BlogPostPage.tsx +++ b/src/pages/BlogPostPage.tsx @@ -189,13 +189,12 @@ export default function BlogPostPage() {