forked from Kieran/zap.stream
chore: formatting
This commit is contained in:
parent
31b8549632
commit
dd4c2bae2b
@ -15,7 +15,12 @@ export function NostrProviderDialog({
|
|||||||
showEditor,
|
showEditor,
|
||||||
showForwards,
|
showForwards,
|
||||||
...others
|
...others
|
||||||
}: { provider: NostrStreamProvider; showEndpoints: boolean; showEditor: boolean, showForwards: boolean } & StreamEditorProps) {
|
}: {
|
||||||
|
provider: NostrStreamProvider;
|
||||||
|
showEndpoints: boolean;
|
||||||
|
showEditor: boolean;
|
||||||
|
showForwards: boolean;
|
||||||
|
} & StreamEditorProps) {
|
||||||
const system = useContext(SnortContext);
|
const system = useContext(SnortContext);
|
||||||
const [topup, setTopup] = useState(false);
|
const [topup, setTopup] = useState(false);
|
||||||
const [info, setInfo] = useState<StreamProviderInfo>();
|
const [info, setInfo] = useState<StreamProviderInfo>();
|
||||||
@ -134,7 +139,9 @@ export function NostrProviderDialog({
|
|||||||
</p>
|
</p>
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
{sortEndpoints(info.endpoints).map(a => (
|
{sortEndpoints(info.endpoints).map(a => (
|
||||||
<span className={`pill bg-gray-1${ep?.name === a.name ? " active" : ""}`} onClick={() => setEndpoint(a)}>
|
<span
|
||||||
|
className={`pill bg-gray-1${ep?.name === a.name ? " active" : ""}`}
|
||||||
|
onClick={() => setEndpoint(a)}>
|
||||||
{a.name}
|
{a.name}
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
@ -202,7 +209,8 @@ export function NostrProviderDialog({
|
|||||||
return tosInput();
|
return tosInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
return <StreamEditor
|
return (
|
||||||
|
<StreamEditor
|
||||||
onFinish={ex => {
|
onFinish={ex => {
|
||||||
provider.updateStreamInfo(system, ex);
|
provider.updateStreamInfo(system, ex);
|
||||||
others.onFinish?.(ex);
|
others.onFinish?.(ex);
|
||||||
@ -223,30 +231,37 @@ export function NostrProviderDialog({
|
|||||||
canSetStream: false,
|
canSetStream: false,
|
||||||
canSetStatus: false,
|
canSetStatus: false,
|
||||||
}}
|
}}
|
||||||
/>;
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function forwardInputs() {
|
function forwardInputs() {
|
||||||
if (!info || !showForwards) return;
|
if (!info || !showForwards) return;
|
||||||
|
|
||||||
return <div className="flex flex-col gap-4">
|
return (
|
||||||
|
<div className="flex flex-col gap-4">
|
||||||
<h3>
|
<h3>
|
||||||
<FormattedMessage defaultMessage="Stream Forwarding" id="W7DNWx" />
|
<FormattedMessage defaultMessage="Stream Forwarding" id="W7DNWx" />
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div className="grid grid-cols-3 gap-2">
|
<div className="grid grid-cols-3 gap-2">
|
||||||
{info.forwards?.map(a => <>
|
{info.forwards?.map(a => (
|
||||||
|
<>
|
||||||
<div className="paper">{a.name}</div>
|
<div className="paper">{a.name}</div>
|
||||||
<AsyncButton className="btn btn-primary" onClick={async () => {
|
<AsyncButton
|
||||||
|
className="btn btn-primary"
|
||||||
|
onClick={async () => {
|
||||||
await provider.removeForward(a.id);
|
await provider.removeForward(a.id);
|
||||||
}}>
|
}}>
|
||||||
<FormattedMessage defaultMessage="Remove" id="G/yZLu" />
|
<FormattedMessage defaultMessage="Remove" id="G/yZLu" />
|
||||||
</AsyncButton>
|
</AsyncButton>
|
||||||
<div></div>
|
<div></div>
|
||||||
</>)}
|
</>
|
||||||
<AddForwardInputs provider={provider} onAdd={() => { }} />
|
))}
|
||||||
|
<AddForwardInputs provider={provider} onAdd={() => {}} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -258,7 +273,13 @@ export function NostrProviderDialog({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AddForwardInputs({ provider, onAdd }: { provider: NostrStreamProvider, onAdd: (name: string, target: string) => void }) {
|
function AddForwardInputs({
|
||||||
|
provider,
|
||||||
|
onAdd,
|
||||||
|
}: {
|
||||||
|
provider: NostrStreamProvider;
|
||||||
|
onAdd: (name: string, target: string) => void;
|
||||||
|
}) {
|
||||||
const [name, setName] = useState("");
|
const [name, setName] = useState("");
|
||||||
const [target, setTarget] = useState("");
|
const [target, setTarget] = useState("");
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
@ -270,19 +291,22 @@ function AddForwardInputs({ provider, onAdd }: { provider: NostrStreamProvider,
|
|||||||
onAdd(name, target);
|
onAdd(name, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
return <>
|
return (
|
||||||
|
<>
|
||||||
<div className="paper">
|
<div className="paper">
|
||||||
<input type="text"
|
<input
|
||||||
placeholder={formatMessage({ defaultMessage: "Human readable name", id: 'QuXHCg' })}
|
type="text"
|
||||||
value={name} onChange={e => setName(e.target.value)} />
|
placeholder={formatMessage({ defaultMessage: "Human readable name", id: "QuXHCg" })}
|
||||||
|
value={name}
|
||||||
|
onChange={e => setName(e.target.value)}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="paper">
|
<div className="paper">
|
||||||
<input type="text"
|
<input type="text" placeholder="rtmp://" value={target} onChange={e => setTarget(e.target.value)} />
|
||||||
placeholder="rtmp://"
|
|
||||||
value={target} onChange={e => setTarget(e.target.value)} />
|
|
||||||
</div>
|
</div>
|
||||||
<AsyncButton className="btn btn-primary" onClick={doAdd}>
|
<AsyncButton className="btn btn-primary" onClick={doAdd}>
|
||||||
<FormattedMessage defaultMessage="Add" id="2/2yg+" />
|
<FormattedMessage defaultMessage="Add" id="2/2yg+" />
|
||||||
</AsyncButton>
|
</AsyncButton>
|
||||||
</>
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
@ -239,6 +239,9 @@
|
|||||||
"Qe1MJu": {
|
"Qe1MJu": {
|
||||||
"defaultMessage": "{name} with {amount}"
|
"defaultMessage": "{name} with {amount}"
|
||||||
},
|
},
|
||||||
|
"QuXHCg": {
|
||||||
|
"defaultMessage": "Human readable name"
|
||||||
|
},
|
||||||
"RJ2VxG": {
|
"RJ2VxG": {
|
||||||
"defaultMessage": "A new version has been detected"
|
"defaultMessage": "A new version has been detected"
|
||||||
},
|
},
|
||||||
@ -275,6 +278,9 @@
|
|||||||
"VA/Z1S": {
|
"VA/Z1S": {
|
||||||
"defaultMessage": "Hide"
|
"defaultMessage": "Hide"
|
||||||
},
|
},
|
||||||
|
"W7DNWx": {
|
||||||
|
"defaultMessage": "Stream Forwarding"
|
||||||
|
},
|
||||||
"W9355R": {
|
"W9355R": {
|
||||||
"defaultMessage": "Unmute"
|
"defaultMessage": "Unmute"
|
||||||
},
|
},
|
||||||
|
@ -79,6 +79,7 @@
|
|||||||
"QRRCp0": "Stream URL",
|
"QRRCp0": "Stream URL",
|
||||||
"QceMQZ": "Goal: {amount}",
|
"QceMQZ": "Goal: {amount}",
|
||||||
"Qe1MJu": "{name} with {amount}",
|
"Qe1MJu": "{name} with {amount}",
|
||||||
|
"QuXHCg": "Human readable name",
|
||||||
"RJ2VxG": "A new version has been detected",
|
"RJ2VxG": "A new version has been detected",
|
||||||
"RJOmzk": "I have read and agree with {provider}''s {terms}.",
|
"RJOmzk": "I have read and agree with {provider}''s {terms}.",
|
||||||
"RS6smY": "Raid Message",
|
"RS6smY": "Raid Message",
|
||||||
@ -91,6 +92,7 @@
|
|||||||
"UJBFYK": "Add Card",
|
"UJBFYK": "Add Card",
|
||||||
"UfSot5": "Past Streams",
|
"UfSot5": "Past Streams",
|
||||||
"VA/Z1S": "Hide",
|
"VA/Z1S": "Hide",
|
||||||
|
"W7DNWx": "Stream Forwarding",
|
||||||
"W9355R": "Unmute",
|
"W9355R": "Unmute",
|
||||||
"X2PZ7D": "Create Goal",
|
"X2PZ7D": "Create Goal",
|
||||||
"XgWvGA": "Reactions",
|
"XgWvGA": "Reactions",
|
||||||
|
Loading…
Reference in New Issue
Block a user