Compare commits

...

4 Commits

Author SHA1 Message Date
37e1a066d1 chore: formatting 2025-05-02 10:23:21 +01:00
6bd92279dc fix: note embed in cards 2025-05-02 10:22:56 +01:00
c2b52c749b chore: remove banner code 2025-04-30 13:48:35 +01:00
becc8ea065 chore: hide store banner 2025-04-30 10:45:12 +01:00
9 changed files with 31 additions and 60 deletions

View File

@ -42,7 +42,7 @@ function loadWhitelist() {
const list = import.meta.env.VITE_SINGLE_PUBLISHER as string | undefined;
if (list) {
return list.split(",").map(a => {
if (a.startsWith('npub')) {
if (a.startsWith("npub")) {
return parseNostrLink(a).id;
} else {
return a;
@ -53,4 +53,4 @@ function loadWhitelist() {
return undefined;
}
export const WHITELIST: Array<string> | undefined = loadWhitelist();
export const WHITELIST: Array<string> | undefined = loadWhitelist();

View File

@ -35,7 +35,7 @@ export function EventIcon({ kind }: { kind?: EventKind }) {
export function NostrEvent({ ev }: { ev: TaggedNostrEvent }) {
const link = NostrLink.fromEvent(ev);
function modalPage(inner: ReactNode) {
return <div className="rounded-2xl px-4 py-3 md:w-[700px] mx-auto w-full">{inner}</div>;
return <div className="rounded-2xl px-4 py-3">{inner}</div>;
}
switch (ev.kind) {
@ -83,6 +83,10 @@ export function NostrEvent({ ev }: { ev: TaggedNostrEvent }) {
export function EventEmbed({ link, ...props }: EventProps & HTMLProps<HTMLDivElement>) {
const event = useEventFeed(link);
if (event) {
return <NostrEvent ev={event} {...props} />;
return (
<div className="md:w-[700px] mx-auto w-full">
<NostrEvent ev={event} {...props} />
</div>
);
}
}

View File

@ -1,16 +1,19 @@
import { NostrLink, TaggedNostrEvent } from "@snort/system";
import { ExternalIconLink } from "./external-link";
import { Profile } from "./profile";
import EventReactions from "./event-reactions";
import { Text } from "@/element/text";
import { Link } from "react-router-dom";
import { Icon } from "./icon";
export function Note({ ev }: { ev: TaggedNostrEvent }) {
return (
<div className="bg-layer-2 rounded-xl px-4 py-3 flex flex-col gap-2">
<div className="flex justify-between items-center">
<Profile pubkey={ev.pubkey} avatarSize={30} />
<ExternalIconLink size={24} href={`https://snort.social/${NostrLink.fromEvent(ev).encode()}`} />
<Link to={`/${NostrLink.fromEvent(ev).encode()}`}>
<Icon name="link" size={24} />
</Link>
</div>
<Text tags={ev.tags} content={ev.content} className="whitespace-pre-line overflow-wrap" />
<EventReactions ev={ev} />

View File

@ -145,7 +145,7 @@ export function StreamEditor({ ev, onFinish, options }: StreamEditorProps) {
}
}
const startsTimestamp = Number(start ?? (new Date().getTime() / 1000));
const startsTimestamp = Number(start ?? new Date().getTime() / 1000);
const startsDate = new Date(startsTimestamp * 1000);
return (

View File

@ -40,7 +40,7 @@ export default function LiveVideoPlayer({ title, stream, status, poster, link, .
<Nip94Player link={link} />
</Suspense>
);
} else if (stream && stream.toLowerCase().endsWith('.m3u8')) {
} else if (stream && stream.toLowerCase().endsWith(".m3u8")) {
// hls video
/* @ts-ignore Web Componenet */
return <hls-video {...props} slot="media" src={stream} playsInline={true} autoPlay={true} />;

View File

@ -12,21 +12,11 @@ export function useStreamsFeed(tag?: string) {
});
if (WHITELIST) {
if (tag) {
rb.withFilter()
.kinds(liveStreamKinds)
.tag("t", [tag])
.authors(WHITELIST);
rb.withFilter()
.kinds(liveStreamKinds)
.tag("t", [tag])
.tag("p", WHITELIST);
rb.withFilter().kinds(liveStreamKinds).tag("t", [tag]).authors(WHITELIST);
rb.withFilter().kinds(liveStreamKinds).tag("t", [tag]).tag("p", WHITELIST);
} else {
rb.withFilter()
.kinds(liveStreamKinds)
.authors(WHITELIST);
rb.withFilter()
.kinds(liveStreamKinds)
.tag("p", WHITELIST);
rb.withFilter().kinds(liveStreamKinds).authors(WHITELIST);
rb.withFilter().kinds(liveStreamKinds).tag("p", WHITELIST);
}
} else {
if (tag) {

View File

@ -170,9 +170,6 @@
"8YT6ja": {
"defaultMessage": "Insert text to speak"
},
"8aAwpp": {
"defaultMessage": "For manual hosting all you need is the HLS URL for the Stream URL field. You should be ale to find this in your hosting setup."
},
"8xVdjn": {
"defaultMessage": "Video Codec"
},
@ -236,6 +233,9 @@
"C81/uG": {
"defaultMessage": "Logout"
},
"CFReLV": {
"defaultMessage": "For manual hosting all you need is the HLS URL for the Stream URL field. You should be able to find this in your hosting setup."
},
"CTgA2G": {
"defaultMessage": "Create a new account if you don't have one already."
},
@ -491,9 +491,6 @@
"QNvtaq": {
"defaultMessage": "Share on X"
},
"QRHNuF": {
"defaultMessage": "What are we streaming today?"
},
"QRRCp0": {
"defaultMessage": "Stream URL"
},
@ -582,6 +579,9 @@
"W7IRLs": {
"defaultMessage": "Your title is too short"
},
"W8nHSd": {
"defaultMessage": "FAQ"
},
"W9355R": {
"defaultMessage": "Unmute"
},
@ -733,6 +733,9 @@
"g5pX+a": {
"defaultMessage": "About"
},
"gJFhNJ": {
"defaultMessage": "What are we streaming today?"
},
"gQxxlw": {
"defaultMessage": "Goal Name"
},
@ -951,9 +954,6 @@
"uksRSi": {
"defaultMessage": "Latest Videos"
},
"vP4dFa": {
"defaultMessage": "Visit {link} to get some sweet zap.stream merch!"
},
"vaZKTn": {
"defaultMessage": "Add more content"
},

View File

@ -2,37 +2,11 @@ import { useStreamsFeed } from "@/hooks/live-streams";
import CategoryLink from "@/element/category/category-link";
import VideoGridSorted from "@/element/video-grid-sorted";
import { AllCategories } from "./category";
import { FormattedMessage } from "react-intl";
import { Link } from "react-router-dom";
import useImgProxy from "@/hooks/img-proxy";
export function RootPage() {
const streams = useStreamsFeed();
const { proxy } = useImgProxy();
const shirtSize = 120;
return (
<div className="flex flex-col gap-6 p-4 min-w-0">
<div className="flex max-md:flex-col gap-2 items-center bg-layer-2 p-4 text-lg font-medium text-pretty">
<img
width={shirtSize}
className="rounded-xl"
src={proxy(
"https://blossom.nogood.studio/f98bc742ba24b2c729420148d736c3c0f58e6551d7dc0e4bd263d78bf2ab58b8.png",
shirtSize,
"f98bc742ba24b2c729420148d736c3c0f58e6551d7dc0e4bd263d78bf2ab58b8",
)}
/>
<FormattedMessage
defaultMessage="Visit {link} to get some sweet zap.stream merch!"
values={{
link: (
<Link to="https://store.zap.stream" className="underline" target="_blank">
store.zap.stream
</Link>
),
}}
/>
</div>
<div className="min-w-0 overflow-x-scroll scrollbar-hidden">
<div className="flex gap-4 ">
{AllCategories.filter(a => a.priority === 0).map(a => (

View File

@ -56,7 +56,6 @@
"7UOvbT": "Offline",
"89UZph": "Configure your streaming software",
"8YT6ja": "Insert text to speak",
"8aAwpp": "For manual hosting all you need is the HLS URL for the Stream URL field. You should be ale to find this in your hosting setup.",
"8xVdjn": "Video Codec",
"9WRlF4": "Send",
"9ZoFpI": "Delete file",
@ -78,6 +77,7 @@
"Bep/gA": "Private key",
"BzQPM+": "Destination",
"C81/uG": "Logout",
"CFReLV": "For manual hosting all you need is the HLS URL for the Stream URL field. You should be able to find this in your hosting setup.",
"CTgA2G": "Create a new account if you don't have one already.",
"CsCUYo": "{n} sats",
"CsS/fy": "{estimate} remaining ({balance} sats @ {rate} sats / {unit})",
@ -162,7 +162,6 @@
"Q3au2v": "About {estimate}",
"Q8Qw5B": "Description",
"QNvtaq": "Share on X",
"QRHNuF": "What are we streaming today?",
"QRRCp0": "Stream URL",
"QWlMq9": "Stream key",
"QceMQZ": "Goal: {amount}",
@ -192,6 +191,7 @@
"VKb1MS": "Categories",
"W7DNWx": "Stream Forwarding",
"W7IRLs": "Your title is too short",
"W8nHSd": "FAQ",
"W9355R": "Unmute",
"WVJZ0U": "Value",
"WcZM+B": "File List",
@ -241,6 +241,7 @@
"fBI91o": "Zap",
"feZ/kG": "Login with Private Key (insecure)",
"g5pX+a": "About",
"gJFhNJ": "What are we streaming today?",
"gQxxlw": "Goal Name",
"gt65Gg": "Stream goals encourage viewers to support streamers via donations.",
"gzsn7k": "{n} messages",
@ -313,7 +314,6 @@
"uYw2LD": "Stream",
"ug01Mk": "Time",
"uksRSi": "Latest Videos",
"vP4dFa": "Visit {link} to get some sweet zap.stream merch!",
"vaZKTn": "Add more content",
"vrTOHJ": "{amount} sats",
"w+2Vw7": "Shorts",