forked from Kieran/zap.stream
chore: Run prettier
This commit is contained in:
parent
90a7d2ca7e
commit
48c48c90c4
@ -17,7 +17,11 @@ function NewStream({ ev, onFinish }: StreamEditorProps) {
|
||||
|
||||
useEffect(() => {
|
||||
if (!currentProvider) {
|
||||
setCurrentProvider(ev !== undefined ? providers.find(a => a.name.toLowerCase() === "manual")! : providers.at(0));
|
||||
setCurrentProvider(
|
||||
ev !== undefined
|
||||
? providers.find((a) => a.name.toLowerCase() === "manual")!
|
||||
: providers.at(0)
|
||||
);
|
||||
}
|
||||
}, [providers, currentProvider]);
|
||||
|
||||
@ -32,7 +36,7 @@ function NewStream({ ev, onFinish }: StreamEditorProps) {
|
||||
currentProvider.updateStreamInfo(ex);
|
||||
if (!ev) {
|
||||
navigate(`/${eventLink(ex)}`, {
|
||||
state: ev
|
||||
state: ev,
|
||||
});
|
||||
} else {
|
||||
onFinish?.(ev);
|
||||
|
@ -88,12 +88,26 @@ export function NostrProviderDialog({
|
||||
function tosInput() {
|
||||
if (!info) return;
|
||||
|
||||
return <>
|
||||
return (
|
||||
<>
|
||||
<div>
|
||||
<div className="flex g12">
|
||||
<input type="checkbox" checked={tos} onChange={e => setTos(e.target.checked)} />
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={tos}
|
||||
onChange={(e) => setTos(e.target.checked)}
|
||||
/>
|
||||
<p>
|
||||
I have read and agree with {info.name}'s <span className="tos-link" onClick={() => window.open(info.tosLink, "popup", "width=400,height=800")}>terms and conditions</span>.
|
||||
I have read and agree with {info.name}'s{" "}
|
||||
<span
|
||||
className="tos-link"
|
||||
onClick={() =>
|
||||
window.open(info.tosLink, "popup", "width=400,height=800")
|
||||
}
|
||||
>
|
||||
terms and conditions
|
||||
</span>
|
||||
.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -108,6 +122,7 @@ export function NostrProviderDialog({
|
||||
</AsyncButton>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
@ -167,26 +182,33 @@ export function NostrProviderDialog({
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
{info.tosAccepted === false ? tosInput() :
|
||||
{info.tosAccepted === false ? (
|
||||
tosInput()
|
||||
) : (
|
||||
<StreamEditor
|
||||
onFinish={(ex) => {
|
||||
provider.updateStreamInfo(ex);
|
||||
others.onFinish?.(ex);
|
||||
}}
|
||||
ev={{
|
||||
ev={
|
||||
{
|
||||
tags: [
|
||||
["title", info.streamInfo?.title ?? ""],
|
||||
["summary", info.streamInfo?.summary ?? ""],
|
||||
["image", info.streamInfo?.image ?? ""],
|
||||
...(info.streamInfo?.content_warning ? [["content-warning", info.streamInfo?.content_warning]] : []),
|
||||
...(info.streamInfo?.tags?.map(a => ["t", a]) ?? [])
|
||||
]
|
||||
} as NostrEvent}
|
||||
...(info.streamInfo?.content_warning
|
||||
? [["content-warning", info.streamInfo?.content_warning]]
|
||||
: []),
|
||||
...(info.streamInfo?.tags?.map((a) => ["t", a]) ?? []),
|
||||
],
|
||||
} as NostrEvent
|
||||
}
|
||||
options={{
|
||||
canSetStream: false,
|
||||
canSetStatus: false,
|
||||
}}
|
||||
/>}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
@ -61,8 +61,8 @@ const router = createBrowserRouter([
|
||||
},
|
||||
{
|
||||
path: "*",
|
||||
element: <CatchAllRoutePage />
|
||||
}
|
||||
element: <CatchAllRoutePage />,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
|
||||
export function CatchAllRoutePage() {
|
||||
//const { ["*"]: param } = useParams();
|
||||
|
||||
return <b className="error">Not found :(</b>
|
||||
return <b className="error">Not found :(</b>;
|
||||
}
|
@ -4,7 +4,12 @@ import { useLocation, useNavigate, useParams } from "react-router-dom";
|
||||
import { Helmet } from "react-helmet";
|
||||
|
||||
import { LiveVideoPlayer } from "element/live-video-player";
|
||||
import { createNostrLink, findTag, getEventFromLocationState, getHost } from "utils";
|
||||
import {
|
||||
createNostrLink,
|
||||
findTag,
|
||||
getEventFromLocationState,
|
||||
getHost,
|
||||
} from "utils";
|
||||
import { Profile, getName } from "element/profile";
|
||||
import { LiveChat } from "element/live-chat";
|
||||
import AsyncButton from "element/async-button";
|
||||
|
@ -53,7 +53,7 @@ export interface StreamProviderInfo {
|
||||
balance?: number;
|
||||
endpoints: Array<StreamProviderEndpoint>;
|
||||
tosAccepted?: boolean;
|
||||
tosLink?: string
|
||||
tosLink?: string;
|
||||
}
|
||||
|
||||
export interface StreamProviderEndpoint {
|
||||
@ -66,11 +66,11 @@ export interface StreamProviderEndpoint {
|
||||
}
|
||||
|
||||
export interface StreamProviderStreamInfo {
|
||||
title: string
|
||||
summary: string
|
||||
image: string
|
||||
tags: Array<string>
|
||||
content_warning: string
|
||||
title: string;
|
||||
summary: string;
|
||||
image: string;
|
||||
tags: Array<string>;
|
||||
content_warning: string;
|
||||
}
|
||||
|
||||
export class ProviderStore extends ExternalStore<Array<StreamProvider>> {
|
||||
|
Loading…
Reference in New Issue
Block a user