From fe7dc293c452a117e9000f7b85ea840bdbf16da0 Mon Sep 17 00:00:00 2001 From: diondiondion Date: Mon, 2 Mar 2026 17:19:13 +0100 Subject: [PATCH] [Glitch] Collection share modal cleanup Port 03b2f77ad243b3b0d419f5e292669e5c40483061 to glitch-soc Signed-off-by: Claire --- .../glitch/components/modal_shell/index.tsx | 19 +++++++------------ .../account_timeline/modals/field_modal.tsx | 14 +++++++++----- .../collections/detail/share_modal.tsx | 14 +++++++++----- .../confirmation_modal.tsx | 14 +++++++++----- .../features/ui/components/modal_root.jsx | 3 +-- .../features/ui/util/async-components.js | 6 ------ .../glitch/styles/mastodon/components.scss | 4 ++++ 7 files changed, 39 insertions(+), 35 deletions(-) diff --git a/app/javascript/flavours/glitch/components/modal_shell/index.tsx b/app/javascript/flavours/glitch/components/modal_shell/index.tsx index 8b6fdcc6ad..8b06087532 100644 --- a/app/javascript/flavours/glitch/components/modal_shell/index.tsx +++ b/app/javascript/flavours/glitch/components/modal_shell/index.tsx @@ -1,16 +1,14 @@ import classNames from 'classnames'; -interface SimpleComponentProps { +interface ModalShellProps { className?: string; children?: React.ReactNode; } -interface ModalShellComponent extends React.FC { - Body: React.FC; - Actions: React.FC; -} - -export const ModalShell: ModalShellComponent = ({ children, className }) => { +export const ModalShell: React.FC = ({ + children, + className, +}) => { return (
{ ); }; -const ModalShellBody: ModalShellComponent['Body'] = ({ +export const ModalShellBody: React.FC = ({ children, className, }) => { @@ -39,7 +37,7 @@ const ModalShellBody: ModalShellComponent['Body'] = ({ ); }; -const ModalShellActions: ModalShellComponent['Actions'] = ({ +export const ModalShellActions: React.FC = ({ children, className, }) => { @@ -51,6 +49,3 @@ const ModalShellActions: ModalShellComponent['Actions'] = ({
); }; - -ModalShell.Body = ModalShellBody; -ModalShell.Actions = ModalShellActions; diff --git a/app/javascript/flavours/glitch/features/account_timeline/modals/field_modal.tsx b/app/javascript/flavours/glitch/features/account_timeline/modals/field_modal.tsx index 4f2e502d7e..d724abd1d9 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/modals/field_modal.tsx +++ b/app/javascript/flavours/glitch/features/account_timeline/modals/field_modal.tsx @@ -4,7 +4,11 @@ import { FormattedMessage } from 'react-intl'; import { Button } from '@/flavours/glitch/components/button'; import { EmojiHTML } from '@/flavours/glitch/components/emoji/html'; -import { ModalShell } from '@/flavours/glitch/components/modal_shell'; +import { + ModalShell, + ModalShellActions, + ModalShellBody, +} from '@/flavours/glitch/components/modal_shell'; import type { AccountField } from '../common'; import { useFieldHtml } from '../hooks/useFieldHtml'; @@ -19,7 +23,7 @@ export const AccountFieldModal: FC<{ const handleValueElement = useFieldHtml(field.valueHasEmojis); return ( - + - - + + - + ); }; diff --git a/app/javascript/flavours/glitch/features/collections/detail/share_modal.tsx b/app/javascript/flavours/glitch/features/collections/detail/share_modal.tsx index 0b3ab2adbc..f77ecc30d6 100644 --- a/app/javascript/flavours/glitch/features/collections/detail/share_modal.tsx +++ b/app/javascript/flavours/glitch/features/collections/detail/share_modal.tsx @@ -13,7 +13,11 @@ import { AvatarGroup } from 'flavours/glitch/components/avatar_group'; import { Button } from 'flavours/glitch/components/button'; import { CopyLinkField } from 'flavours/glitch/components/form_fields'; import { IconButton } from 'flavours/glitch/components/icon_button'; -import { ModalShell } from 'flavours/glitch/components/modal_shell'; +import { + ModalShell, + ModalShellActions, + ModalShellBody, +} from 'flavours/glitch/components/modal_shell'; import { useAppDispatch } from 'flavours/glitch/store'; import { AuthorNote } from '.'; @@ -64,7 +68,7 @@ export const CollectionShareModal: React.FC<{ return ( - +

{isNew ? ( - + - +
- + ); }; diff --git a/app/javascript/flavours/glitch/features/ui/components/confirmation_modals/confirmation_modal.tsx b/app/javascript/flavours/glitch/features/ui/components/confirmation_modals/confirmation_modal.tsx index c139b7772a..815f6fd09b 100644 --- a/app/javascript/flavours/glitch/features/ui/components/confirmation_modals/confirmation_modal.tsx +++ b/app/javascript/flavours/glitch/features/ui/components/confirmation_modals/confirmation_modal.tsx @@ -3,7 +3,11 @@ import { useCallback } from 'react'; import { FormattedMessage, defineMessages } from 'react-intl'; import { Button } from 'flavours/glitch/components/button'; -import { ModalShell } from 'flavours/glitch/components/modal_shell'; +import { + ModalShell, + ModalShellActions, + ModalShellBody, +} from 'flavours/glitch/components/modal_shell'; export interface BaseConfirmationModalProps { onClose: () => void; @@ -66,14 +70,14 @@ export const ConfirmationModal: React.FC< return ( - +

{title}

{message &&

{message}

} {extraContent ?? children} -
+ - +