diff --git a/src/renderer/src/components/AccountButton/LoginButton.tsx b/src/renderer/src/components/AccountButton/LoginButton.tsx index 00366f6..b319d77 100644 --- a/src/renderer/src/components/AccountButton/LoginButton.tsx +++ b/src/renderer/src/components/AccountButton/LoginButton.tsx @@ -5,12 +5,12 @@ import { LogIn } from 'lucide-react' export default function LoginButton({ variant = 'titlebar' }: { - variant?: 'titlebar' | 'sidebar' + variant?: 'titlebar' | 'sidebar' | 'small-screen-titlebar' }) { const { checkLogin } = useNostr() let triggerComponent: React.ReactNode - if (variant === 'titlebar') { + if (variant === 'titlebar' || variant === 'small-screen-titlebar') { triggerComponent = } else { triggerComponent = ( diff --git a/src/renderer/src/components/AccountButton/ProfileButton.tsx b/src/renderer/src/components/AccountButton/ProfileButton.tsx index c2b0bb8..2ee889a 100644 --- a/src/renderer/src/components/AccountButton/ProfileButton.tsx +++ b/src/renderer/src/components/AccountButton/ProfileButton.tsx @@ -18,7 +18,7 @@ export default function ProfileButton({ variant = 'titlebar' }: { pubkey: string - variant?: 'titlebar' | 'sidebar' + variant?: 'titlebar' | 'sidebar' | 'small-screen-titlebar' }) { const { t } = useTranslation() const { logout } = useNostr() @@ -33,7 +33,18 @@ export default function ProfileButton({ if (variant === 'titlebar') { triggerComponent = ( + ) + } else if (variant === 'small-screen-titlebar') { + triggerComponent = ( + )} diff --git a/src/renderer/src/components/Content/index.tsx b/src/renderer/src/components/Content/index.tsx index 13a0522..4265ab3 100644 --- a/src/renderer/src/components/Content/index.tsx +++ b/src/renderer/src/components/Content/index.tsx @@ -79,7 +79,13 @@ const Content = memo( if (embeddedNotes.length) { embeddedNotes.forEach((note, index) => { const id = note.split(':')[1] - nodes.push() + nodes.push( + + ) }) } diff --git a/src/renderer/src/components/Embedded/EmbeddedNote.tsx b/src/renderer/src/components/Embedded/EmbeddedNote.tsx index b55786c..254d58e 100644 --- a/src/renderer/src/components/Embedded/EmbeddedNote.tsx +++ b/src/renderer/src/components/Embedded/EmbeddedNote.tsx @@ -1,13 +1,14 @@ import { useFetchEvent } from '@renderer/hooks' import { toNoStrudelArticle, toNoStrudelNote, toNoStrudelStream } from '@renderer/lib/link' +import { cn } from '@renderer/lib/utils' import { kinds } from 'nostr-tools' import ShortTextNoteCard from '../NoteCard/ShortTextNoteCard' -export function EmbeddedNote({ noteId }: { noteId: string }) { +export function EmbeddedNote({ noteId, className }: { noteId: string; className?: string }) { const { event } = useFetchEvent(noteId) return event && event.kind === kinds.ShortTextNote ? ( - + ) : ( {!hideStats && ( - + )} ) diff --git a/src/renderer/src/components/NoteCard/ShortTextNoteCard.tsx b/src/renderer/src/components/NoteCard/ShortTextNoteCard.tsx index 277eaef..ffa8149 100644 --- a/src/renderer/src/components/NoteCard/ShortTextNoteCard.tsx +++ b/src/renderer/src/components/NoteCard/ShortTextNoteCard.tsx @@ -34,7 +34,7 @@ export default function ShortTextNoteCard({ >
{loading ? t('loading...') : until ? t('load more older replies') : null}
- {replies.length > 0 && (loading || until) && } + {replies.length > 0 && (loading || until) && }
{replies.map((reply, index) => { const info = replyMap[reply.id] diff --git a/src/renderer/src/components/ScrollToTopButton/index.tsx b/src/renderer/src/components/ScrollToTopButton/index.tsx index fa333a3..12c45fb 100644 --- a/src/renderer/src/components/ScrollToTopButton/index.tsx +++ b/src/renderer/src/components/ScrollToTopButton/index.tsx @@ -1,40 +1,25 @@ import { Button } from '@renderer/components/ui/button' import { cn } from '@renderer/lib/utils' import { ChevronUp } from 'lucide-react' -import { useEffect, useState } from 'react' export default function ScrollToTopButton({ scrollAreaRef, - className + className, + visible = true }: { scrollAreaRef: React.RefObject className?: string + visible?: boolean }) { - const [showScrollToTop, setShowScrollToTop] = useState(false) - const handleScrollToTop = () => { scrollAreaRef.current?.scrollTo({ top: 0, behavior: 'smooth' }) } - const handleScroll = () => { - if (scrollAreaRef.current) { - setShowScrollToTop(scrollAreaRef.current.scrollTop > 600) - } - } - - useEffect(() => { - const scrollArea = scrollAreaRef.current - scrollArea?.addEventListener('scroll', handleScroll) - return () => { - scrollArea?.removeEventListener('scroll', handleScroll) - } - }, []) - return ( ) : themeSetting === 'light' ? ( ) : (