diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx index 4ce1009a..7591ed2a 100644 --- a/src/components/Settings.tsx +++ b/src/components/Settings.tsx @@ -162,7 +162,7 @@ const Settings: React.FC = ({ settings, onSave, onClose, relayPoo - + diff --git a/src/components/Settings/OfflineModeSettings.tsx b/src/components/Settings/OfflineModeSettings.tsx index a35e4ccc..cd26e02f 100644 --- a/src/components/Settings/OfflineModeSettings.tsx +++ b/src/components/Settings/OfflineModeSettings.tsx @@ -1,12 +1,21 @@ import React from 'react' +import { useNavigate } from 'react-router-dom' import { UserSettings } from '../../services/settingsService' interface OfflineModeSettingsProps { settings: UserSettings onUpdate: (updates: Partial) => void + onClose?: () => void } -const OfflineModeSettings: React.FC = ({ settings, onUpdate }) => { +const OfflineModeSettings: React.FC = ({ settings, onUpdate, onClose }) => { + const navigate = useNavigate() + + const handleLinkClick = (url: string) => { + if (onClose) onClose() + navigate(`/r/${encodeURIComponent(url)}`) + } + return (

Offline Mode

@@ -36,6 +45,57 @@ const OfflineModeSettings: React.FC = ({ settings, onU Rebroadcast events to all relays
+ + ) } diff --git a/src/components/Settings/RelaySettings.tsx b/src/components/Settings/RelaySettings.tsx index f71f1597..c20f181c 100644 --- a/src/components/Settings/RelaySettings.tsx +++ b/src/components/Settings/RelaySettings.tsx @@ -1,5 +1,4 @@ import React from 'react' -import { useNavigate } from 'react-router-dom' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faCheckCircle, faCircle, faClock, faPlane } from '@fortawesome/free-solid-svg-icons' import { RelayStatus } from '../../services/relayStatusService' @@ -11,16 +10,10 @@ interface RelaySettingsProps { onClose?: () => void } -const RelaySettings: React.FC = ({ relayStatuses, onClose }) => { - const navigate = useNavigate() +const RelaySettings: React.FC = ({ relayStatuses }) => { const activeRelays = relayStatuses.filter(r => r.isInPool) const recentRelays = relayStatuses.filter(r => !r.isInPool) - const handleLinkClick = (url: string) => { - if (onClose) onClose() - navigate(`/r/${encodeURIComponent(url)}`) - } - const formatRelayUrl = (url: string) => { return url.replace(/^wss?:\/\//, '').replace(/\/$/, '') } @@ -186,57 +179,6 @@ const RelaySettings: React.FC = ({ relayStatuses, onClose }) No relay connections found

)} - - ) }