diff --git a/src/features/settings/index.tsx b/src/features/settings/index.tsx index f2e53b867..c3b26376f 100644 --- a/src/features/settings/index.tsx +++ b/src/features/settings/index.tsx @@ -2,9 +2,10 @@ import React, { useEffect } from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { fetchMfa } from 'soapbox/actions/mfa'; +import CopyableInput from 'soapbox/components/copyable-input'; import List, { ListItem } from 'soapbox/components/list'; -import { Card, CardBody, CardHeader, CardTitle, Column, Text } from 'soapbox/components/ui'; -import { useAppDispatch, useAppSelector, useFeatures, useOwnAccount } from 'soapbox/hooks'; +import { Card, CardBody, CardHeader, CardTitle, Column, FormGroup, Text } from 'soapbox/components/ui'; +import { useAppDispatch, useAppSelector, useFeatures, useInstance, useOwnAccount } from 'soapbox/hooks'; import Preferences from '../preferences'; @@ -44,6 +45,7 @@ const Settings = () => { const mfa = useAppSelector((state) => state.security.get('mfa')); const features = useFeatures(); const { account } = useOwnAccount(); + const instance = useInstance(); const isMfaEnabled = mfa.getIn(['settings', 'totp']); @@ -169,6 +171,20 @@ const Settings = () => { )} + + {instance.nostr && ( + <> + + } /> + + + + }> + + + + + )} ); diff --git a/src/features/ui/components/nostr-panel.tsx b/src/features/ui/components/nostr-panel.tsx deleted file mode 100644 index 8cdf5115e..000000000 --- a/src/features/ui/components/nostr-panel.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import { FormattedMessage } from 'react-intl'; - -import CopyableInput from 'soapbox/components/copyable-input'; -import { Text, Widget } from 'soapbox/components/ui'; -import { useInstance } from 'soapbox/hooks/useInstance'; - -const NostrPanel = () => { - const instance = useInstance(); - const relay = instance.nostr?.relay; - - if (!relay) { - return null; - } - - return ( - }> - - - - - - - ); -}; - -export default NostrPanel; diff --git a/src/features/ui/util/async-components.ts b/src/features/ui/util/async-components.ts index 737ee24f2..85d1b9bb9 100644 --- a/src/features/ui/util/async-components.ts +++ b/src/features/ui/util/async-components.ts @@ -178,4 +178,3 @@ export const EditRuleModal = lazy(() => import('soapbox/features/ui/components/m export const AdminNostrRelays = lazy(() => import('soapbox/features/admin/nostr-relays')); export const ZapPayRequestModal = lazy(() => import('soapbox/features/ui/components/modals/zap-pay-request')); export const ZapInvoiceModal = lazy(() => import('soapbox/features/ui/components/modals/zap-invoice')); -export const NostrPanel = lazy(() => import('soapbox/features/ui/components/nostr-panel')); diff --git a/src/pages/home-page.tsx b/src/pages/home-page.tsx index 5b690f410..3f292eacb 100644 --- a/src/pages/home-page.tsx +++ b/src/pages/home-page.tsx @@ -15,7 +15,6 @@ import { BirthdayPanel, CtaBanner, AnnouncementsPanel, - NostrPanel, } from 'soapbox/features/ui/util/async-components'; import { useAppSelector, useOwnAccount, useFeatures, useSoapboxConfig, useDraggedFiles, useAppDispatch } from 'soapbox/hooks'; import { useIsMobile } from 'soapbox/hooks/useIsMobile'; @@ -100,7 +99,6 @@ const HomePage: React.FC = ({ children }) => { {(hasCrypto && cryptoLimit > 0 && me) && ( )} - {(hasPatron && me) && ( )}