chore: Update translations

This commit is contained in:
2024-02-27 19:16:50 +00:00
parent d59e0c9f36
commit ae37f361ce
42 changed files with 684 additions and 543 deletions

View File

@ -110,7 +110,7 @@ function DashboardChatList({ link }: { link: NostrLink }) {
<Profile pubkey={a} avatarSize={32} gap={4} />
<div className="flex gap-2">
<MuteButton pubkey={a} />
<DefaultButton onClick={() => { }} className="font-bold">
<DefaultButton onClick={() => {}} className="font-bold">
<FormattedMessage defaultMessage="Zap" id="fBI91o" />
</DefaultButton>
</div>
@ -173,13 +173,16 @@ function DashboardHighlightZap({ zap }: { zap: ParsedZap }) {
function DashboardRaidButton({ link }: { link: NostrLink }) {
const [show, setShow] = useState(false);
return (<>
<DefaultButton onClick={() => setShow(true)}>
<FormattedMessage defaultMessage="Raid" id="4iBdw1" />
</DefaultButton>
{show && <Modal id="raid-menu" onClose={() => setShow(false)}>
<DashboardRaidMenu link={link} onClose={() => setShow(false)} />
</Modal>}
</>
return (
<>
<DefaultButton onClick={() => setShow(true)}>
<FormattedMessage defaultMessage="Raid" id="4iBdw1" />
</DefaultButton>
{show && (
<Modal id="raid-menu" onClose={() => setShow(false)}>
<DashboardRaidMenu link={link} onClose={() => setShow(false)} />
</Modal>
)}
</>
);
}

View File

@ -110,15 +110,18 @@ export function LayoutPage() {
function loggedOut() {
if (login) return;
return (<>
<BorderButton onClick={() => setShowLogin(true)}>
<FormattedMessage defaultMessage="Login" id="AyGauy" />
<Icon name="login" />
</BorderButton>
{showLogin && <Modal id="login">
<LoginSignup close={() => setShowLogin(false)} />
</Modal>}
</>
return (
<>
<BorderButton onClick={() => setShowLogin(true)}>
<FormattedMessage defaultMessage="Login" id="AyGauy" />
<Icon name="login" />
</BorderButton>
{showLogin && (
<Modal id="login">
<LoginSignup close={() => setShowLogin(false)} />
</Modal>
)}
</>
);
}

View File

@ -4,22 +4,24 @@ import { SendZapsDialog } from "@/element/send-zap";
import { EventBuilder, NostrLink } from "@snort/system";
export default function MockPage() {
const pubkey = "cf45a6ba1363ad7ed213a078e710d24115ae721c9b47bd1ebf4458eaefb4c2a5";
const fakeStream = new EventBuilder()
.kind(LIVE_STREAM)
.pubKey(pubkey)
.tag(["d", "mock"])
.tag(["title", "Example Stream"])
.tag(["summary", "An example mock stream for debugging"])
.tag(["streaming", "https://example.com/live.m3u8"])
.tag(["t", "nostr"])
.tag(["t", "mock"])
.processContent()
.build();
const fakeStreamLink = NostrLink.fromEvent(fakeStream);
const pubkey = "cf45a6ba1363ad7ed213a078e710d24115ae721c9b47bd1ebf4458eaefb4c2a5";
const fakeStream = new EventBuilder()
.kind(LIVE_STREAM)
.pubKey(pubkey)
.tag(["d", "mock"])
.tag(["title", "Example Stream"])
.tag(["summary", "An example mock stream for debugging"])
.tag(["streaming", "https://example.com/live.m3u8"])
.tag(["t", "nostr"])
.tag(["t", "mock"])
.processContent()
.build();
const fakeStreamLink = NostrLink.fromEvent(fakeStream);
return <div className="">
<LiveChat link={fakeStreamLink} ev={fakeStream} height={600} />
<SendZapsDialog lnurl="donate@snort.social" aTag={fakeStreamLink.toEventTag()![1]} pubkey={pubkey} />
return (
<div className="">
<LiveChat link={fakeStreamLink} ev={fakeStream} height={600} />
<SendZapsDialog lnurl="donate@snort.social" aTag={fakeStreamLink.toEventTag()![1]} pubkey={pubkey} />
</div>
}
);
}

View File

@ -75,7 +75,15 @@ export function ProfilePage() {
);
}
function ProfileHeader({ profile, link, streams }: { profile?: CachedMetadata, link: NostrLink, streams: Array<NostrEvent> }) {
function ProfileHeader({
profile,
link,
streams,
}: {
profile?: CachedMetadata;
link: NostrLink;
streams: Array<NostrEvent>;
}) {
const navigate = useNavigate();
const liveEvent = useMemo(() => {
return streams.find(ev => findTag(ev, "status") === StreamState.Live);
@ -90,44 +98,46 @@ function ProfileHeader({ profile, link, streams }: { profile?: CachedMetadata, l
}
}
return <div className="flex max-sm:flex-col gap-3 justify-between">
<div className="flex items-center gap-3">
<div className="relative flex flex-col items-center">
<Avatar user={profile} pubkey={link.id} size={88} className="border border-4" />
{isLive && <StatePill state={StreamState.Live} onClick={goToLive} className="absolute bottom-0 -mb-2" />}
return (
<div className="flex max-sm:flex-col gap-3 justify-between">
<div className="flex items-center gap-3">
<div className="relative flex flex-col items-center">
<Avatar user={profile} pubkey={link.id} size={88} className="border border-4" />
{isLive && <StatePill state={StreamState.Live} onClick={goToLive} className="absolute bottom-0 -mb-2" />}
</div>
<div className="flex flex-col gap-1">
{profile?.name && <h1 className="name">{profile.name}</h1>}
{profile?.about && (
<p className="text-neutral-400">
<Text content={profile.about} tags={[]} />
</p>
)}
</div>
</div>
<div className="flex flex-col gap-1">
{profile?.name && <h1 className="name">{profile.name}</h1>}
{profile?.about && (
<p className="text-neutral-400">
<Text content={profile.about} tags={[]} />
</p>
<div className="flex gap-2 items-center">
{zapTarget && (
<SendZapsDialog
aTag={liveEvent ? `${liveEvent.kind}:${liveEvent.pubkey}:${findTag(liveEvent, "d")}` : undefined}
lnurl={zapTarget}
button={
<DefaultButton>
<Icon name="zap-filled" className="zap-button-icon" />
<FormattedMessage defaultMessage="Zap" id="fBI91o" />
</DefaultButton>
}
targetName={profile?.name || link.id}
/>
)}
<FollowButton pubkey={link.id} />
<MuteButton pubkey={link.id} />
</div>
</div>
<div className="flex gap-2 items-center">
{zapTarget && (
<SendZapsDialog
aTag={liveEvent ? `${liveEvent.kind}:${liveEvent.pubkey}:${findTag(liveEvent, "d")}` : undefined}
lnurl={zapTarget}
button={
<DefaultButton>
<Icon name="zap-filled" className="zap-button-icon" />
<FormattedMessage defaultMessage="Zap" id="fBI91o" />
</DefaultButton>
}
targetName={profile?.name || link.id}
/>
)}
<FollowButton pubkey={link.id} />
<MuteButton pubkey={link.id} />
</div>
</div>
);
}
function ProfileStreamList({ streams }: { streams: Array<TaggedNostrEvent> }) {
if (streams.length === 0) {
return <FormattedMessage defaultMessage="No streams yet" id="0rVLjV" />
return <FormattedMessage defaultMessage="No streams yet" id="0rVLjV" />;
}
return (
<div className="grid gap-4 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-8">
@ -153,23 +163,25 @@ function ProfileZapGoals({ link }: { link: NostrLink }) {
const limit = 5;
const goals = useGoals(link.id, false, limit);
if (goals.length === 0) {
return <FormattedMessage defaultMessage="No goals yet" id="ZaNcK4" />
return <FormattedMessage defaultMessage="No goals yet" id="ZaNcK4" />;
}
return goals
.sort((a, b) => a.created_at > b.created_at ? -1 : 1)
.sort((a, b) => (a.created_at > b.created_at ? -1 : 1))
.slice(0, limit)
.map(a => <div key={a.id} className="bg-layer-1 rounded-xl px-4 py-3">
<Goal ev={a} confetti={false} />
</div>);
.map(a => (
<div key={a.id} className="bg-layer-1 rounded-xl px-4 py-3">
<Goal ev={a} confetti={false} />
</div>
));
}
function ProfileClips({ link }: { link: NostrLink }) {
const clips = useClips(link, 10);
if (clips.length === 0) {
return <FormattedMessage defaultMessage="No clips yet" id="ObZZEz" />
return <FormattedMessage defaultMessage="No clips yet" id="ObZZEz" />;
}
return clips.map(a => {
const r = findTag(a, "r");
return <video src={r} />
})
}
return <video src={r} />;
});
}

View File

@ -38,9 +38,7 @@ export function StreamProvidersPage() {
<div className="paper">
<h3>{mapName(p)}</h3>
{mapLogo(p)}
<DefaultButton onClick={() => navigate(p)}>
+ Configure
</DefaultButton>
<DefaultButton onClick={() => navigate(p)}>+ Configure</DefaultButton>
</div>
);
}

View File

@ -82,9 +82,7 @@ export function ConfigureOwncast() {
<input type="password" value={token} onChange={e => setToken(e.target.value)} />
</div>
</div>
<DefaultButton onClick={tryConnect}>
Connect
</DefaultButton>
<DefaultButton onClick={tryConnect}>Connect</DefaultButton>
</div>
<div>{status()}</div>
</div>

View File

@ -75,19 +75,21 @@ export function SettingsPage() {
);
}
case Tab.Stream: {
return <>
<h1>
<FormattedMessage defaultMessage="Stream" id="uYw2LD" />
</h1>
<div className="flex flex-col gap-4">
<NostrProviderDialog
provider={unwrap(providers.find(a => a.name === "zap.stream")) as NostrStreamProvider}
showEndpoints={true}
showEditor={false}
showForwards={true}
/>
</div>
</>
return (
<>
<h1>
<FormattedMessage defaultMessage="Stream" id="uYw2LD" />
</h1>
<div className="flex flex-col gap-4">
<NostrProviderDialog
provider={unwrap(providers.find(a => a.name === "zap.stream")) as NostrStreamProvider}
showEndpoints={true}
showEditor={false}
showForwards={true}
/>
</div>
</>
);
}
}
}