From 7563dff621aaedfdb4ae493f3d85af01dba42d34 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Thu, 5 Jun 2025 08:54:09 -0700 Subject: [PATCH] Move relay status to its own component --- src/app/components/SpaceRelayStatus.svelte | 70 ++++++++++++++++++++++ src/routes/spaces/[relay]/+page.svelte | 59 +----------------- 2 files changed, 72 insertions(+), 57 deletions(-) create mode 100644 src/app/components/SpaceRelayStatus.svelte diff --git a/src/app/components/SpaceRelayStatus.svelte b/src/app/components/SpaceRelayStatus.svelte new file mode 100644 index 0000000..f29235d --- /dev/null +++ b/src/app/components/SpaceRelayStatus.svelte @@ -0,0 +1,70 @@ + + +
+

+ + Relay Status +

+
+ + {#if $relay?.profile} + {@const {software, version, supported_nips, limitation} = $relay.profile} +
+ {#if owner} +
+ Administrator: +
+ {/if} + {#if $relay?.profile?.contact} +
+ Contact: {$relay.profile.contact} +
+ {/if} + {#if software} +
+ Software: {software} +
+ {/if} + {#if version} +
+ Version: {version} +
+ {/if} + {#if Array.isArray(supported_nips)} +

+ Supported NIPs: {supported_nips.join(", ")} +

+ {/if} + {#if limitation?.auth_required} +

+ Auth Required +

+ {/if} + {#if limitation?.payment_required} +

+ Payment Required +

+ {/if} + {#if limitation?.min_pow_difficulty} +

+ Min PoW: {limitation?.min_pow_difficulty} +

+ {/if} +
+ {/if} +
+
diff --git a/src/routes/spaces/[relay]/+page.svelte b/src/routes/spaces/[relay]/+page.svelte index 8497429..3c283d0 100644 --- a/src/routes/spaces/[relay]/+page.svelte +++ b/src/routes/spaces/[relay]/+page.svelte @@ -7,8 +7,6 @@ import Button from "@lib/components/Button.svelte" import PageBar from "@lib/components/PageBar.svelte" import PageContent from "@lib/components/PageContent.svelte" - import SocketStatusIndicator from "@lib/components/SocketStatusIndicator.svelte" - import ProfileLink from "@app/components/ProfileLink.svelte" import MenuSpaceButton from "@app/components/MenuSpaceButton.svelte" import ProfileLatest from "@app/components/ProfileLatest.svelte" import SpaceJoin from "@app/components/SpaceJoin.svelte" @@ -16,6 +14,7 @@ import RelayDescription from "@app/components/RelayDescription.svelte" import SpaceQuickLinks from "@app/components/SpaceQuickLinks.svelte" import SpaceRecentActivity from "@app/components/SpaceRecentActivity.svelte" + import SpaceRelayStatus from "@app/components/SpaceRelayStatus.svelte" import {decodeRelay, userRoomsByUrl} from "@app/state" import {makeChatPath} from "@app/routes" import {pushModal} from "@app/modal" @@ -84,61 +83,7 @@
-
-

- - Relay Status -

-
- - {#if $relay?.profile} - {@const {software, version, supported_nips, limitation} = $relay.profile} -
- {#if owner} -
- Administrator: -
- {/if} - {#if $relay?.profile?.contact} -
- Contact: {$relay.profile.contact} -
- {/if} - {#if software} -
- Software: {software} -
- {/if} - {#if version} -
- Version: {version} -
- {/if} - {#if Array.isArray(supported_nips)} -

- Supported NIPs: {supported_nips.join(", ")} -

- {/if} - {#if limitation?.auth_required} -

- Auth Required -

- {/if} - {#if limitation?.payment_required} -

- Payment Required -

- {/if} - {#if limitation?.min_pow_difficulty} -

- Min PoW: {limitation?.min_pow_difficulty} -

- {/if} -
- {/if} -
-
+ {#if owner}