From 2dc1d29f520a98d4499d6680a9efb1045c1f4764 Mon Sep 17 00:00:00 2001 From: hzrd149 Date: Tue, 7 Feb 2023 17:04:19 -0600 Subject: [PATCH] show connected relays on mobile --- src/components/connected-relays.tsx | 49 ++++++++++++++++++++++++++--- src/components/page.tsx | 21 +++++++------ 2 files changed, 56 insertions(+), 14 deletions(-) diff --git a/src/components/connected-relays.tsx b/src/components/connected-relays.tsx index cbba92a2b..674f05eca 100644 --- a/src/components/connected-relays.tsx +++ b/src/components/connected-relays.tsx @@ -1,10 +1,26 @@ import { useState } from "react"; -import { Text } from "@chakra-ui/react"; +import { + Text, + useDisclosure, + Modal, + ModalOverlay, + ModalContent, + ModalHeader, + ModalBody, + ModalCloseButton, + Button, + Spacer, +} from "@chakra-ui/react"; import { Relay } from "../services/relays"; import relayPool from "../services/relays/relay-pool"; import { useInterval } from "react-use"; +import { RelayStatus } from "../views/settings/relay-status"; +import { useIsMobile } from "../hooks/use-is-mobile"; +import { RelayIcon } from "./icons"; export const ConnectedRelays = () => { + const isMobile = useIsMobile(); + const { isOpen, onOpen, onClose } = useDisclosure(); const [relays, setRelays] = useState(relayPool.getRelays()); useInterval(() => { @@ -12,11 +28,34 @@ export const ConnectedRelays = () => { }, 1000); const connected = relays.filter((relay) => relay.okay); - const disconnected = relays.filter((relay) => !relay.okay); return ( - - {connected.length}/{relays.length} of relays connected - + <> + + + + + Connected Relays + + + {relays.map((relay) => ( + + {relay.url} + + ))} + + + + ); }; diff --git a/src/components/page.tsx b/src/components/page.tsx index 2205285ab..e2b0d892d 100644 --- a/src/components/page.tsx +++ b/src/components/page.tsx @@ -21,15 +21,18 @@ const MobileProfileHeader = () => { return ( - } - aria-label="Notifications" - title="Notifications" - size="sm" - to="/notifications" - /> + + + } + aria-label="Notifications" + title="Notifications" + size="sm" + to="/notifications" + /> + ); };