diff --git a/src/features/compose/components/compose-form.tsx b/src/features/compose/components/compose-form.tsx index d4d61e834..8b0f7b19a 100644 --- a/src/features/compose/components/compose-form.tsx +++ b/src/features/compose/components/compose-form.tsx @@ -1,8 +1,8 @@ import clsx from 'clsx'; import { CLEAR_EDITOR_COMMAND, TextNode, type LexicalEditor, $getRoot } from 'lexical'; import React, { Suspense, useCallback, useEffect, useRef, useState } from 'react'; -import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; -import { Link, useHistory } from 'react-router-dom'; +import { defineMessages, useIntl } from 'react-intl'; +import { useHistory } from 'react-router-dom'; import { length } from 'stringz'; import { @@ -39,7 +39,6 @@ import SpoilerInput from './spoiler-input'; import TextCharacterCounter from './text-character-counter'; import UploadForm from './upload-form'; import VisualCharacterCounter from './visual-character-counter'; -import Warning from './warning'; import type { Emoji } from 'soapbox/features/emoji'; @@ -73,7 +72,6 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab const compose = useCompose(id); const showSearch = useAppSelector((state) => state.search.submitted && !state.search.hidden); const maxTootChars = instance.configuration.statuses.max_characters; - const scheduledStatusCount = useAppSelector((state) => state.scheduled_statuses.size); const features = useFeatures(); const { @@ -246,25 +244,6 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab return ( - {scheduledStatusCount > 0 && !event && !group && ( - - - - ) }} - />) - } - /> - )} - {!shouldCondense && !event && !group && groupId && } diff --git a/src/features/compose/containers/warning-container.tsx b/src/features/compose/containers/warning-container.tsx index 858404c27..1ecc99359 100644 --- a/src/features/compose/containers/warning-container.tsx +++ b/src/features/compose/containers/warning-container.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; -import { useAppSelector, useCompose } from 'soapbox/hooks'; +import { useAppSelector, useCompose, useOwnAccount, useSettingsNotifications } from 'soapbox/hooks'; import { selectOwnAccount } from 'soapbox/selectors'; import Warning from '../components/warning'; @@ -15,11 +15,60 @@ interface IWarningWrapper { const WarningWrapper: React.FC = ({ composeId }) => { const compose = useCompose(composeId); + const scheduledStatusCount = useAppSelector((state) => state.scheduled_statuses.size); + const { account } = useOwnAccount(); + const settingsNotifications = useSettingsNotifications(); const needsLockWarning = useAppSelector((state) => compose.privacy === 'private' && !selectOwnAccount(state)!.locked); const hashtagWarning = (compose.privacy !== 'public' && compose.privacy !== 'group') && APPROX_HASHTAG_RE.test(compose.text); const directMessageWarning = compose.privacy === 'direct'; + if (scheduledStatusCount > 0) { + return ( + + + + ) }} + />) + } + /> + ); + } + + if (account?.source?.nostr?.nip05 === undefined) { + if (settingsNotifications.has('needsNip05')) { + return ( + + + + ), + }} + /> + ); + } else { + return ( + + ); + } + } + if (needsLockWarning) { return (