From 04cdc1e08fb04a073ea5542be4fdef4b5aa6ddcc Mon Sep 17 00:00:00 2001 From: Kieran Date: Mon, 4 Dec 2023 12:18:47 +0000 Subject: [PATCH] chore: formatting --- postcss.config.js | 2 +- src/element/nostr-provider-dialog.tsx | 128 ++++++++++++++------------ src/pages/settings-page.tsx | 28 +++--- src/pages/widgets/zaps.tsx | 6 +- src/translations/en.json | 2 +- 5 files changed, 89 insertions(+), 77 deletions(-) diff --git a/postcss.config.js b/postcss.config.js index 33ad091..12a703d 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/src/element/nostr-provider-dialog.tsx b/src/element/nostr-provider-dialog.tsx index 84d09f4..32aee37 100644 --- a/src/element/nostr-provider-dialog.tsx +++ b/src/element/nostr-provider-dialog.tsx @@ -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(); @@ -119,73 +123,75 @@ export function NostrProviderDialog({ provider, showEndpoints, ...others }: { pr function streamEndpoints() { if (!info) return; - return <> - {info.endpoints.length > 1 && ( + return ( + <> + {info.endpoints.length > 1 && ( +
+

+ +

+
+ {sortEndpoints(info.endpoints).map(a => ( + setEndpoint(a)}> + {a.name} + + ))} +
+
+ )}

- + +

+
+ +
+
+
+

+

- {sortEndpoints(info.endpoints).map(a => ( - setEndpoint(a)}> - {a.name} - +
+ +
+ +
+
+
+

+ +

+
+
+ +
+ +
+ + + +
+
+

+ +

+
+ {ep?.capabilities?.map(a => ( + {parseCapability(a)} ))}
- )} -
-

- -

-
- -
-
-
-

- -

-
-
- -
- -
-
-
-

- -

-
-
- -
- -
- - - -
-
-

- -

-
- {ep?.capabilities?.map(a => ( - {parseCapability(a)} - ))} -
-
- + + ); } return ( <> diff --git a/src/pages/settings-page.tsx b/src/pages/settings-page.tsx index a5c492e..d3200f0 100644 --- a/src/pages/settings-page.tsx +++ b/src/pages/settings-page.tsx @@ -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 <> -

- -

- a.name === "zap.stream"))} showEndpoints={true} /> - + return ( + <> +

+ +

+ a.name === "zap.stream"))} showEndpoints={true} /> + + ); } } } function tabName(t: Tab) { switch (t) { - case Tab.Account: return ; - case Tab.Stream: return + case Tab.Account: + return ; + case Tab.Stream: + return ; } } @@ -86,10 +89,9 @@ export function SettingsPage() {
- {[Tab.Account, Tab.Stream].map(t =>
setTab(t)}> - {tabName(t)} -
- )} + {[Tab.Account, Tab.Stream].map(t => ( +
setTab(t)}>{tabName(t)}
+ ))}
{tabContent()}
diff --git a/src/pages/widgets/zaps.tsx b/src/pages/widgets/zaps.tsx index b02a843..94c4b8d 100644 --- a/src/pages/widgets/zaps.tsx +++ b/src/pages/widgets/zaps.tsx @@ -64,7 +64,11 @@ export function ZapAlerts({ link }: { link: NostrLink }) { } }, [zap?.id]); - return
{zap && }
; + return ( +
+ {zap && } +
+ ); } export function ZapAlertItem({ item }: { item: ParsedZap }) { diff --git a/src/translations/en.json b/src/translations/en.json index 4901279..165d611 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -146,4 +146,4 @@ "y867Vs": "Volume", "yzKwBQ": "eg. nsec1xyz", "zVDHAu": "Zap Alert" -} \ No newline at end of file +}