diff --git a/src/features/ui/components/nostr-panel.tsx b/src/features/ui/components/nostr-panel.tsx new file mode 100644 index 000000000..8cdf5115e --- /dev/null +++ b/src/features/ui/components/nostr-panel.tsx @@ -0,0 +1,27 @@ +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 7d413bc5b..c32e0768e 100644 --- a/src/features/ui/util/async-components.ts +++ b/src/features/ui/util/async-components.ts @@ -176,3 +176,4 @@ export const Relays = lazy(() => import('soapbox/features/admin/relays')); export const Rules = lazy(() => import('soapbox/features/admin/rules')); export const EditRuleModal = lazy(() => import('soapbox/features/ui/components/modals/edit-rule-modal')); export const AdminNostrRelays = lazy(() => import('soapbox/features/admin/nostr-relays')); +export const NostrPanel = lazy(() => import('soapbox/features/ui/components/nostr-panel')); \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index d869a77ba..25dada21c 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1148,6 +1148,8 @@ "new_group_panel.title": "Create Group", "nostr_extension.found": "Sign in with browser extension.", "nostr_extension.not_found": "Browser extension not found.", + "nostr_panel.message": "Connect with any Nostr client.", + "nostr_panel.title": "Nostr Relay", "nostr_relays.read_only": "Read-only", "nostr_relays.read_write": "Read & write", "nostr_relays.title": "Relays", diff --git a/src/pages/home-page.tsx b/src/pages/home-page.tsx index c13662189..5b690f410 100644 --- a/src/pages/home-page.tsx +++ b/src/pages/home-page.tsx @@ -15,6 +15,7 @@ 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'; @@ -96,22 +97,23 @@ const HomePage: React.FC = ({ children }) => { {me && features.announcements && ( )} - {features.trends && ( - + {(hasCrypto && cryptoLimit > 0 && me) && ( + )} + {(hasPatron && me) && ( )} - {(hasCrypto && cryptoLimit > 0 && me) && ( - - )} - {features.birthdays && ( )} + {features.trends && ( + + )} {me && features.suggestions && ( )} +