From 5197f433b23f20db516b05eecd3ae5a4c484554d Mon Sep 17 00:00:00 2001 From: Kieran Date: Mon, 4 Dec 2023 11:23:10 +0000 Subject: [PATCH] chore: cleanup --- index.html | 2 +- src/element/new-stream.tsx | 2 +- src/element/nostr-provider-dialog.tsx | 12 +++++++++--- src/intl.tsx | 7 +++---- src/login.ts | 2 +- src/translations/en.json | 12 ++++++++++-- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index fc2e45b..1efd7ed 100644 --- a/index.html +++ b/index.html @@ -13,6 +13,6 @@
- + diff --git a/src/element/new-stream.tsx b/src/element/new-stream.tsx index 18690d7..fbece3e 100644 --- a/src/element/new-stream.tsx +++ b/src/element/new-stream.tsx @@ -54,7 +54,7 @@ function NewStream({ ev, onFinish }: StreamEditorProps) { ); } case StreamProviders.NostrType: { - return ; + return ; } case StreamProviders.Owncast: { return; diff --git a/src/element/nostr-provider-dialog.tsx b/src/element/nostr-provider-dialog.tsx index c3b5ea5..804a6ed 100644 --- a/src/element/nostr-provider-dialog.tsx +++ b/src/element/nostr-provider-dialog.tsx @@ -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(); @@ -117,8 +117,9 @@ export function NostrProviderDialog({ provider, ...others }: { provider: StreamP ); } - return ( - <> + function streamEndpoints() { + if (!info) return; + return <> {info.endpoints.length > 1 && (

@@ -184,6 +185,11 @@ export function NostrProviderDialog({ provider, ...others }: { provider: StreamP ))}

+ + } + return ( + <> + {showEndpoints && streamEndpoints()} {info.tosAccepted === false ? ( tosInput() ) : ( diff --git a/src/intl.tsx b/src/intl.tsx index 1d328ed..06ae47f 100644 --- a/src/intl.tsx +++ b/src/intl.tsx @@ -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; - const ent = Object.entries(typed).map(([k, v]) => [k, v.defaultMessage]); +function importLang(src: { default: Record }) { + const ent = Object.entries(src.default).map(([k, v]) => [k, v.defaultMessage]); return Object.fromEntries(ent) as Record; } diff --git a/src/login.ts b/src/login.ts index 222d5dd..c7183d4 100644 --- a/src/login.ts +++ b/src/login.ts @@ -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", diff --git a/src/translations/en.json b/src/translations/en.json index 99b0c8c..4901279 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -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" -} +} \ No newline at end of file