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