diff --git a/src/element/collapsible.css b/src/element/collapsible.css index 809bb82..e4e31ee 100644 --- a/src/element/collapsible.css +++ b/src/element/collapsible.css @@ -39,6 +39,3 @@ .collapsed-event-header svg { color: var(--text-muted); } - -.expanded-event { -} diff --git a/src/element/collapsible.tsx b/src/element/collapsible.tsx index f556d57..34be76c 100644 --- a/src/element/collapsible.tsx +++ b/src/element/collapsible.tsx @@ -67,12 +67,7 @@ export function CollapsibleEvent({ link }: { link: NostrLink }) { - {open && event && ( -
- {" "} - -
- )} + {open && event && }
); diff --git a/src/element/markdown.css b/src/element/markdown.css index f3cc513..42c309b 100644 --- a/src/element/markdown.css +++ b/src/element/markdown.css @@ -18,16 +18,3 @@ font-weight: 400; line-height: 29px; /* 161.111% */ } - -.markdown img:not(.emoji):not(.note-avatar) { - max-height: 720px; - margin-top: 8px; - width: 100%; - border-radius: 6px; -} - -.markdown video { - width: 100%; - aspect-ratio: 4/3; - border-radius: 6px; -} diff --git a/src/element/markdown.tsx b/src/element/markdown.tsx index a31874c..313ed45 100644 --- a/src/element/markdown.tsx +++ b/src/element/markdown.tsx @@ -4,17 +4,12 @@ import { useMemo } from "react"; import ReactMarkdown from "react-markdown"; import { HyperText } from "element/hypertext"; -import { - transformText, - type Fragment, - type NostrComponents, -} from "element/text"; +import { transformText, type Fragment } from "element/text"; import type { Tags } from "types"; interface MarkdownProps { content: string; tags?: Tags; - customComponents?: NostrComponents; } interface LinkProps { @@ -26,36 +21,20 @@ interface ComponentProps { children?: Array; } -export function Markdown({ - content, - tags = [], - customComponents, -}: MarkdownProps) { +export function Markdown({ content, tags = [] }: MarkdownProps) { const components = useMemo(() => { return { li: ({ children, ...props }: ComponentProps) => { - return ( - children && ( -
  • - {transformText(children, tags, customComponents)} -
  • - ) - ); + return children &&
  • {transformText(children, tags)}
  • ; }, td: ({ children }: ComponentProps) => { - return ( - children && {transformText(children, tags, customComponents)} - ); + return children && {transformText(children, tags)}; }, th: ({ children }: ComponentProps) => { - return ( - children && {transformText(children, tags, customComponents)} - ); + return children && {transformText(children, tags)}; }, p: ({ children }: ComponentProps) => { - return ( - children &&

    {transformText(children, tags, customComponents)}

    - ); + return children &&

    {transformText(children, tags)}

    ; }, a: ({ href, children }: LinkProps) => { return href && {children}; diff --git a/src/element/stream-cards.css b/src/element/stream-cards.css index be27ce3..ad7d5a9 100644 --- a/src/element/stream-cards.css +++ b/src/element/stream-cards.css @@ -174,73 +174,3 @@ .stream-card { max-width: 343px; } - -.top-zappers-card .top-zappers-leaderboard { - border: 1px solid; - padding: 4px 8px; - border-radius: 12px; - border-color: var(--border); -} - -.top-zappers-card .top-zapper-container { - display: flex; - align-items: center; - justify-content: space-between; -} - -.top-zapper-container .zap-amount { - display: flex; - align-items: center; - gap: 4px; -} - -.top-zapper-container .top-zapper-amount { - font-size: 18px; - font-weight: 500; - line-height: 22px; -} - -.top-zappers-card .top-zappers-leaderboard { - display: flex; - flex-direction: column; -} - -.top-zapper-container.first .profile { - background: var(--gradient-purple); - background-clip: text; - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; -} - -.top-zapper-container.second .profile { - background: var(--gradient-yellow); - background-clip: text; - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; -} - -.top-zapper-container.third .profile { - background: var(--gradient-orange); - background-clip: text; - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; -} - -.top-zapper-container.live .profile { - background-size: 300% 300%; - animation: animatedgradient 3s ease alternate infinite; -} - -@keyframes animatedgradient { - 0% { - background-position: 0% 50%; - } - - 50% { - background-position: 100% 50%; - } - - 100% { - background-position: 0% 50%; - } -} diff --git a/src/element/stream-cards.tsx b/src/element/stream-cards.tsx index 48f588f..16ea55e 100644 --- a/src/element/stream-cards.tsx +++ b/src/element/stream-cards.tsx @@ -12,16 +12,12 @@ import { Icon } from "element/icon"; import { ExternalLink } from "element/external-link"; import { FileUploader } from "element/file-uploader"; import { Markdown } from "element/markdown"; -import { Profile } from "element/profile"; import { useLogin } from "hooks/login"; import { useCards, useUserCards } from "hooks/cards"; -import { useZaps } from "hooks/zaps"; -import useTopZappers from "hooks/top-zappers"; import { CARD, USER_CARDS } from "const"; import { toTag, findTag } from "utils"; import { Login, System } from "index"; import type { Tags } from "types"; -import { formatSats } from "number"; interface CardType { identifier: string; @@ -430,14 +426,12 @@ export function StreamCardEditor({ pubkey, tags }: StreamCardEditorProps) { interface StreamCardsProps { host: string; - isLive: boolean; } -export function ReadOnlyStreamCards({ host, isLive }: StreamCardsProps) { +export function ReadOnlyStreamCards({ host }: StreamCardsProps) { const cards = useCards(host); return (
    - {cards.length === 99 && } {cards.map((ev) => ( ))} @@ -445,42 +439,7 @@ export function ReadOnlyStreamCards({ host, isLive }: StreamCardsProps) { ); } -interface TopZappersProps { - host: string; - isLive: boolean; - n?: number; -} - -function TopZappers({ host, isLive, n = 5 }: TopZappersProps) { - const zaps = useZaps(host); - const topZappers = useTopZappers(zaps); - return topZappers.length > 0 ? ( -
    -

    Top Zappers

    -
    - {topZappers - .filter((z) => z.pubkey !== "anon") - .slice(0, n) - .map((z, idx) => ( -
    - -
    - -

    {formatSats(z.total)}

    -
    -
    - ))} -
    -
    - ) : null; -} - -export function StreamCards({ host, isLive }: StreamCardsProps) { +export function StreamCards({ host }: StreamCardsProps) { const login = useLogin(); const canEdit = login?.pubkey === host; return ( @@ -488,7 +447,7 @@ export function StreamCards({ host, isLive }: StreamCardsProps) { {canEdit ? ( ) : ( - + )} ); diff --git a/src/element/text.css b/src/element/text.css deleted file mode 100644 index c4228f4..0000000 --- a/src/element/text.css +++ /dev/null @@ -1,13 +0,0 @@ -.text img:not(.emoji):not(.note-avatar) { - max-height: 720px; - margin-top: 8px; - width: 100%; - border-radius: 6px; -} - -.text video { - width: 100%; - margin-top: 8px; - aspect-ratio: 4/3; - border-radius: 6px; -} diff --git a/src/element/text.tsx b/src/element/text.tsx index 55aa64a..4aece15 100644 --- a/src/element/text.tsx +++ b/src/element/text.tsx @@ -1,4 +1,3 @@ -import "./text.css"; import { useMemo, type ReactNode, type FunctionComponent } from "react"; import { diff --git a/src/index.css b/src/index.css index a8bb77e..c277153 100644 --- a/src/index.css +++ b/src/index.css @@ -260,13 +260,6 @@ div.paper { margin: 6px; } -.dialog-trigger { - font-size: 15px; - background: transparent; - border: none; - display: inline; -} - .ctx-menu { font-size: 16px; font-weight: 700; diff --git a/src/pages/stream-page.tsx b/src/pages/stream-page.tsx index 8d0245d..e34c154 100644 --- a/src/pages/stream-page.tsx +++ b/src/pages/stream-page.tsx @@ -3,9 +3,6 @@ import { parseNostrLink, TaggedRawEvent } from "@snort/system"; import { useLocation, useNavigate, useParams } from "react-router-dom"; import { Helmet } from "react-helmet"; -import { NostrEvent } from "@snort/system"; -import { useUserProfile } from "@snort/system-react"; - import { LiveVideoPlayer } from "element/live-video-player"; import { createNostrLink, @@ -20,10 +17,13 @@ import { useLogin } from "hooks/login"; import { useZapGoal } from "hooks/goals"; import { StreamState, System } from "index"; import { SendZapsDialog } from "element/send-zap"; +import { NostrEvent } from "@snort/system"; +import { useUserProfile } from "@snort/system-react"; import { NewStreamDialog } from "element/new-stream"; import { Tags } from "element/tags"; import { StatePill } from "element/state-pill"; import { StreamCards } from "element/stream-cards"; +import { formatSats } from "number"; import { StreamTimer } from "element/stream-time"; import { ShareMenu } from "element/share-menu"; import { @@ -31,7 +31,6 @@ import { isContentWarningAccepted, } from "element/content-warning"; import { useCurrentStreamFeed } from "hooks/current-stream-feed"; -import { formatSats } from "number"; function ProfileInfo({ ev, goal }: { ev?: NostrEvent; goal?: TaggedRawEvent }) { const login = useLogin(); @@ -157,7 +156,7 @@ export function StreamPage() {
    - +