@@ -64,7 +64,7 @@ export default function RelayInfo({ url }: { url: string }) {
{relayInfo.version && (
Version
-
+
{relayInfo.version}
diff --git a/src/hooks/useFetchRelayList.tsx b/src/hooks/useFetchRelayList.tsx
index 6c6f12e5..e227b874 100644
--- a/src/hooks/useFetchRelayList.tsx
+++ b/src/hooks/useFetchRelayList.tsx
@@ -3,7 +3,11 @@ import { TRelayList } from '@/types'
import { useEffect, useState } from 'react'
export function useFetchRelayList(pubkey?: string | null) {
- const [relayList, setRelayList] = useState
({ write: [], read: [] })
+ const [relayList, setRelayList] = useState({
+ write: [],
+ read: [],
+ originalRelays: []
+ })
const [isFetching, setIsFetching] = useState(true)
useEffect(() => {
diff --git a/src/pages/secondary/ProfilePage/index.tsx b/src/pages/secondary/ProfilePage/index.tsx
index a91f1915..ec1aeea8 100644
--- a/src/pages/secondary/ProfilePage/index.tsx
+++ b/src/pages/secondary/ProfilePage/index.tsx
@@ -51,10 +51,6 @@ export default function ProfilePage({ id, index }: { id?: string; index?: number
() => (profile?.pubkey ? generateImageByPubkey(profile?.pubkey) : ''),
[profile]
)
- const relayCount = useMemo(
- () => new Set(relayList.write.concat(relayList.read)).size,
- [relayList]
- )
const isSelf = accountPubkey === profile?.pubkey
if (!profile && isFetching) {
@@ -128,7 +124,7 @@ export default function ProfilePage({ id, index }: { id?: string; index?: number
to={isSelf ? toRelaySettings('mailbox') : toOthersRelaySettings(pubkey)}
className="flex gap-1 hover:underline w-fit"
>
- {relayCount}
+ {relayList.originalRelays.length}
{t('Relays')}
diff --git a/src/pages/secondary/RelayPage/index.tsx b/src/pages/secondary/RelayPage/index.tsx
index 5f80b9e5..b7188f0f 100644
--- a/src/pages/secondary/RelayPage/index.tsx
+++ b/src/pages/secondary/RelayPage/index.tsx
@@ -4,8 +4,8 @@ import SaveRelayDropdownMenu from '@/components/SaveRelayDropdownMenu'
import { Button } from '@/components/ui/button'
import SecondaryPageLayout from '@/layouts/SecondaryPageLayout'
import { normalizeUrl, simplifyUrl } from '@/lib/url'
-import { ListPlus } from 'lucide-react'
-import { useMemo } from 'react'
+import { Check, Copy, ListPlus } from 'lucide-react'
+import { useMemo, useState } from 'react'
import NotFoundPage from '../NotFoundPage'
export default function RelayPage({ url, index }: { url?: string; index?: number }) {
@@ -20,13 +20,7 @@ export default function RelayPage({ url, index }: { url?: string; index?: number
-
-
- }
+ controls={}
displayScrollToTopButton
>
@@ -34,3 +28,25 @@ export default function RelayPage({ url, index }: { url?: string; index?: number
)
}
+
+function RelayPageControls({ url }: { url: string }) {
+ const [copied, setCopied] = useState(false)
+ const handleCopy = () => {
+ navigator.clipboard.writeText(url)
+ setCopied(true)
+ setTimeout(() => setCopied(false), 2000)
+ }
+
+ return (
+ <>
+
+
+
+
+ >
+ )
+}