diff --git a/packages/pl-fe/src/features/compose/components/warning.tsx b/packages/pl-fe/src/features/compose/components/warning.tsx index 5d7fabfb0..64134f3e9 100644 --- a/packages/pl-fe/src/features/compose/components/warning.tsx +++ b/packages/pl-fe/src/features/compose/components/warning.tsx @@ -5,17 +5,28 @@ import Motion from '../../ui/util/optional-motion'; interface IWarning { message: React.ReactNode; + animated?: boolean; } /** Warning message displayed in ComposeForm. */ -const Warning: React.FC = ({ message }) => ( - - {({ opacity, scaleX, scaleY }) => ( -
- {message} -
- )} -
-); +const Warning: React.FC = ({ message, animated }) => { + const className = 'rounded border border-solid border-gray-400 bg-transparent px-2.5 py-2 text-xs text-gray-900 dark:border-gray-800 dark:text-white'; + + if (animated) return ( + + {({ opacity, scaleX, scaleY }) => ( +
+ {message} +
+ )} +
+ ); + + return ( +
+ {message} +
+ ); +}; export { Warning as default }; diff --git a/packages/pl-fe/src/features/compose/containers/warning-container.tsx b/packages/pl-fe/src/features/compose/containers/warning-container.tsx index 67fbbec3a..9c733f2ba 100644 --- a/packages/pl-fe/src/features/compose/containers/warning-container.tsx +++ b/packages/pl-fe/src/features/compose/containers/warning-container.tsx @@ -37,6 +37,7 @@ const WarningWrapper: React.FC = ({ composeId }) => { }} /> )} + animated /> ); } @@ -50,6 +51,7 @@ const WarningWrapper: React.FC = ({ composeId }) => { defaultMessage="This post won't be listed under any hashtag as it is unlisted. Only public posts can be searched by hashtag." /> )} + animated /> ); } @@ -64,7 +66,7 @@ const WarningWrapper: React.FC = ({ composeId }) => { ); - return ; + return ; } return null; diff --git a/packages/pl-fe/src/locales/en.json b/packages/pl-fe/src/locales/en.json index f8833b04e..a092b4a3c 100644 --- a/packages/pl-fe/src/locales/en.json +++ b/packages/pl-fe/src/locales/en.json @@ -1007,6 +1007,7 @@ "interaction_policies.entry.public": "Everyone", "interaction_policies.fail": "Failed to update interaction policies", "interaction_policies.mentioned_warning": "Mentioned users can always reply.", + "interaction_policies.preferences_hint": "Control, who can interact with this post. You can also configure the default interaction policies in Preferences > Interaction policies.", "interaction_policies.rule.always": "Always", "interaction_policies.rule.with_approval": "Require approval", "interaction_policies.success": "Updated interaction policies", diff --git a/packages/pl-fe/src/modals/compose-interaction-policy-modal.tsx b/packages/pl-fe/src/modals/compose-interaction-policy-modal.tsx index 8a71c6d45..7b4261be4 100644 --- a/packages/pl-fe/src/modals/compose-interaction-policy-modal.tsx +++ b/packages/pl-fe/src/modals/compose-interaction-policy-modal.tsx @@ -1,9 +1,11 @@ import React, { useEffect } from 'react'; import { FormattedMessage } from 'react-intl'; +import { Link } from 'react-router-dom'; import { changeComposeInteractionPolicyOption } from 'pl-fe/actions/compose'; import Modal from 'pl-fe/components/ui/modal'; import Stack from 'pl-fe/components/ui/stack'; +import Warning from 'pl-fe/features/compose/components/warning'; import { useAppDispatch } from 'pl-fe/hooks/use-app-dispatch'; import { useCompose } from 'pl-fe/hooks/use-compose'; import { InteractionPolicyConfig, type Policy, type Rule, type Scope } from 'pl-fe/pages/settings/interaction-policies'; @@ -51,6 +53,21 @@ const ComposeInteractionPolicyModal: React.FC + ( + + {children} + + ), + }} + /> + } + />