chore: cleanup

This commit is contained in:
Kieran 2023-12-04 11:23:10 +00:00
parent 711d9d12b2
commit 5197f433b2
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
6 changed files with 25 additions and 12 deletions

View File

@ -13,6 +13,6 @@
<body>
<div id="root"></div>
<script src="src/index.tsx" type="module"></script>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>

View File

@ -54,7 +54,7 @@ function NewStream({ ev, onFinish }: StreamEditorProps) {
);
}
case StreamProviders.NostrType: {
return <NostrProviderDialog provider={currentProvider} onFinish={onFinish} ev={ev} />;
return <NostrProviderDialog provider={currentProvider} onFinish={onFinish} ev={ev} showEndpoints={false} />;
}
case StreamProviders.Owncast: {
return;

View File

@ -9,7 +9,7 @@ import { StreamEditor, StreamEditorProps } from "./stream-editor";
import Spinner from "./spinner";
import AsyncButton from "./async-button";
export function NostrProviderDialog({ provider, ...others }: { provider: StreamProvider } & 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>();
@ -117,8 +117,9 @@ export function NostrProviderDialog({ provider, ...others }: { provider: StreamP
);
}
return (
<>
function streamEndpoints() {
if (!info) return;
return <>
{info.endpoints.length > 1 && (
<div>
<p>
@ -184,6 +185,11 @@ export function NostrProviderDialog({ provider, ...others }: { provider: StreamP
))}
</div>
</div>
</>
}
return (
<>
{showEndpoints && streamEndpoints()}
{info.tosAccepted === false ? (
tosInput()
) : (

View File

@ -22,11 +22,10 @@ export const AllLocales = [
"fr-FR",
"pt-BR",
"ru-RU",
] as const;
];
function importLang(src: any) {
const typed = src.default as Record<string, { defaultMessage: string }>;
const ent = Object.entries(typed).map(([k, v]) => [k, v.defaultMessage]);
function importLang(src: { default: Record<string, { defaultMessage: string }> }) {
const ent = Object.entries(src.default).map(([k, v]) => [k, v.defaultMessage]);
return Object.fromEntries(ent) as Record<string, string>;
}

View File

@ -2,7 +2,7 @@ import { bytesToHex } from "@noble/curves/abstract/utils";
import { schnorr } from "@noble/curves/secp256k1";
import { ExternalStore, unwrap } from "@snort/shared";
import { EventPublisher, Nip7Signer, PrivateKeySigner } from "@snort/system";
import type { EmojiPack, Tags } from "types";
import type { EmojiPack, Tags } from "@/types";
export enum LoginType {
Nip7 = "nip7",

View File

@ -8,6 +8,7 @@
"04lmFi": "Save Key",
"0GfNiL": "Stream Zap Goals",
"0VV/sK": "Goal",
"0hNxBy": "Starts",
"1EYCdR": "Tags",
"1qsXCO": "eg. name@wallet.com",
"2/2yg+": "Add",
@ -24,10 +25,10 @@
"5kx+2v": "Server Url",
"6Z2pvJ": "Stream Providers",
"6pr6hJ": "Minimum amount for text to speech",
"79lLl+": "Music",
"8YT6ja": "Insert text to speak",
"9WRlF4": "Send",
"9a9+ww": "Title",
"9anxhq": "Starts",
"AIHaPH": "{person} zapped {amount} sats",
"Atr2p4": "NSFW Content",
"AukrPM": "No viewer data available",
@ -35,6 +36,7 @@
"BGxpTN": "Stream Chat",
"Bep/gA": "Private key",
"C81/uG": "Logout",
"CsCUYo": "{n} sats",
"D3idYv": "Settings",
"DZKuuP": "Logged in as",
"Dn82AL": "Live",
@ -42,6 +44,7 @@
"FjDlus": "You can always replace it with your own address later.",
"Fodi9+": "Get paid by viewers",
"G/yZLu": "Remove",
"GGaJMU": "Top Chatters",
"Gq6x9o": "Cover Image",
"H/bNs9": "Save this and keep it safe! If you lose this key, you won't be able to access your account ever again. Yep, it's that serious!",
"H5+NAX": "Balance",
@ -50,6 +53,7 @@
"I1kjHI": "Supports {markdown}",
"IJDKz3": "Zap amount in {currency}",
"INlWvJ": "OR",
"J/+m9y": "Stream Duration {duration} mins",
"JEsxDw": "Uploading...",
"Jq3FDz": "Content",
"K3r6DQ": "Delete",
@ -79,6 +83,7 @@
"VA/Z1S": "Hide",
"W9355R": "Unmute",
"X2PZ7D": "Create Goal",
"XgWvGA": "Reactions",
"YPh5Nq": "@ {rate}",
"Z8ZOEY": "This method is insecure. We recommend using a {nostrlink}",
"ZmqxZs": "You can change this later",
@ -93,12 +98,15 @@
"fBI91o": "Zap",
"fc2iho": "Add File",
"feZ/kG": "Login with Private Key (insecure)",
"gzsn7k": "{n} messages",
"hGQqkW": "Schedule",
"hMzcSq": "Messages",
"heyxZL": "Enable text to speech",
"hpl4BP": "Chat Widget",
"ieGrWo": "Follow",
"itPgxd": "Profile",
"izWS4J": "Unfollow",
"jgOqxt": "Widgets",
"jr4+vD": "Markdown",
"jvo0vs": "Save",
"k21gTS": "e.g. about me",
@ -138,4 +146,4 @@
"y867Vs": "Volume",
"yzKwBQ": "eg. nsec1xyz",
"zVDHAu": "Zap Alert"
}
}