forked from Kieran/zap.stream
chore: formatting
This commit is contained in:
parent
eb58fa4d2e
commit
04cdc1e08f
@ -3,4 +3,4 @@ module.exports = {
|
|||||||
tailwindcss: {},
|
tailwindcss: {},
|
||||||
autoprefixer: {},
|
autoprefixer: {},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
@ -9,7 +9,11 @@ import { StreamEditor, StreamEditorProps } from "./stream-editor";
|
|||||||
import Spinner from "./spinner";
|
import Spinner from "./spinner";
|
||||||
import AsyncButton from "./async-button";
|
import AsyncButton from "./async-button";
|
||||||
|
|
||||||
export function NostrProviderDialog({ provider, showEndpoints, ...others }: { provider: StreamProvider, showEndpoints: boolean } & StreamEditorProps) {
|
export function NostrProviderDialog({
|
||||||
|
provider,
|
||||||
|
showEndpoints,
|
||||||
|
...others
|
||||||
|
}: { provider: StreamProvider; showEndpoints: 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>();
|
||||||
@ -119,7 +123,8 @@ export function NostrProviderDialog({ provider, showEndpoints, ...others }: { pr
|
|||||||
|
|
||||||
function streamEndpoints() {
|
function streamEndpoints() {
|
||||||
if (!info) return;
|
if (!info) return;
|
||||||
return <>
|
return (
|
||||||
|
<>
|
||||||
{info.endpoints.length > 1 && (
|
{info.endpoints.length > 1 && (
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>
|
||||||
@ -186,6 +191,7 @@ export function NostrProviderDialog({ provider, showEndpoints, ...others }: { pr
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -9,7 +9,6 @@ import { useLogin } from "@/hooks/login";
|
|||||||
import Copy from "@/element/copy";
|
import Copy from "@/element/copy";
|
||||||
import { NostrProviderDialog } from "@/element/nostr-provider-dialog";
|
import { NostrProviderDialog } from "@/element/nostr-provider-dialog";
|
||||||
import { useStreamProvider } from "@/hooks/stream-provider";
|
import { useStreamProvider } from "@/hooks/stream-provider";
|
||||||
import { StreamProviders } from "@/providers";
|
|
||||||
|
|
||||||
const enum Tab {
|
const enum Tab {
|
||||||
Account,
|
Account,
|
||||||
@ -61,20 +60,24 @@ export function SettingsPage() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
case Tab.Stream: {
|
case Tab.Stream: {
|
||||||
return <>
|
return (
|
||||||
|
<>
|
||||||
<h1>
|
<h1>
|
||||||
<FormattedMessage defaultMessage="Stream Key" id="LknBsU" />
|
<FormattedMessage defaultMessage="Stream Key" id="LknBsU" />
|
||||||
</h1>
|
</h1>
|
||||||
<NostrProviderDialog provider={unwrap(providers.find(a => a.name === "zap.stream"))} showEndpoints={true} />
|
<NostrProviderDialog provider={unwrap(providers.find(a => a.name === "zap.stream"))} showEndpoints={true} />
|
||||||
</>
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function tabName(t: Tab) {
|
function tabName(t: Tab) {
|
||||||
switch (t) {
|
switch (t) {
|
||||||
case Tab.Account: return <FormattedMessage defaultMessage="Account" id="TwyMau" />;
|
case Tab.Account:
|
||||||
case Tab.Stream: return <FormattedMessage defaultMessage="Stream" id="uYw2LD" />
|
return <FormattedMessage defaultMessage="Account" id="TwyMau" />;
|
||||||
|
case Tab.Stream:
|
||||||
|
return <FormattedMessage defaultMessage="Stream" id="uYw2LD" />;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,10 +89,9 @@ export function SettingsPage() {
|
|||||||
</h1>
|
</h1>
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<div className="flex gap-2 tab-options">
|
<div className="flex gap-2 tab-options">
|
||||||
{[Tab.Account, Tab.Stream].map(t => <div onClick={() => setTab(t)}>
|
{[Tab.Account, Tab.Stream].map(t => (
|
||||||
{tabName(t)}
|
<div onClick={() => setTab(t)}>{tabName(t)}</div>
|
||||||
</div>
|
))}
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="tab-content">{tabContent()}</div>
|
<div className="tab-content">{tabContent()}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -64,7 +64,11 @@ export function ZapAlerts({ link }: { link: NostrLink }) {
|
|||||||
}
|
}
|
||||||
}, [zap?.id]);
|
}, [zap?.id]);
|
||||||
|
|
||||||
return <div className="flex items-center flex-col gap-2 zap-alerts-widget">{zap && <ZapAlertItem key={zap.id} item={zap} />}</div>;
|
return (
|
||||||
|
<div className="flex items-center flex-col gap-2 zap-alerts-widget">
|
||||||
|
{zap && <ZapAlertItem key={zap.id} item={zap} />}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ZapAlertItem({ item }: { item: ParsedZap }) {
|
export function ZapAlertItem({ item }: { item: ParsedZap }) {
|
||||||
|
Loading…
Reference in New Issue
Block a user