mirror of
https://github.com/lumina-rocks/lumina.git
synced 2026-06-05 02:01:47 +02:00
Show interaction buttons in PictureCard only when user is logged in
This commit is contained in:
@@ -12,6 +12,7 @@ import { useNavigate } from 'react-router-dom';
|
||||
import { nip19 } from 'nostr-tools';
|
||||
import { ReactionButton } from '@/components/ReactionButton';
|
||||
import { ZapButton } from '@/components/ZapButton';
|
||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||
|
||||
interface PictureCardProps {
|
||||
event: NostrEvent;
|
||||
@@ -61,6 +62,7 @@ export function PictureCard({ event }: PictureCardProps) {
|
||||
const metadata: NostrMetadata | undefined = author.data?.metadata;
|
||||
const [currentImageIndex, setCurrentImageIndex] = useState(0);
|
||||
const navigate = useNavigate();
|
||||
const { user } = useCurrentUser();
|
||||
|
||||
const displayName = metadata?.display_name || metadata?.name || genUserName(event.pubkey);
|
||||
const profileImage = metadata?.picture;
|
||||
@@ -193,11 +195,13 @@ export function PictureCard({ event }: PictureCardProps) {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Interaction buttons - always at bottom */}
|
||||
<div className="flex items-center gap-2 pt-3 mt-auto border-t">
|
||||
<ReactionButton target={event} showCount buttonVariant="ghost" />
|
||||
<ZapButton target={event} showCount buttonVariant="ghost" />
|
||||
</div>
|
||||
{/* Interaction buttons - only show when logged in */}
|
||||
{user && (
|
||||
<div className="flex items-center gap-2 pt-3 mt-auto border-t">
|
||||
<ReactionButton target={event} showCount buttonVariant="ghost" />
|
||||
<ZapButton target={event} showCount buttonVariant="ghost" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user