diff --git a/app/soapbox/components/status-action-bar.tsx b/app/soapbox/components/status-action-bar.tsx index 011fc63a8..6735c1b29 100644 --- a/app/soapbox/components/status-action-bar.tsx +++ b/app/soapbox/components/status-action-bar.tsx @@ -1,4 +1,3 @@ -import classNames from 'clsx'; import { List as ImmutableList } from 'immutable'; import React from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; @@ -16,6 +15,7 @@ import { initReport } from 'soapbox/actions/reports'; import { deleteStatus, editStatus, toggleMuteStatus } from 'soapbox/actions/statuses'; import EmojiButtonWrapper from 'soapbox/components/emoji-button-wrapper'; import StatusActionButton from 'soapbox/components/status-action-button'; +import { HStack } from 'soapbox/components/ui'; import DropdownMenuContainer from 'soapbox/containers/dropdown-menu-container'; import { useAppDispatch, useAppSelector, useFeatures, useOwnAccount, useSettings, useSoapboxConfig } from 'soapbox/hooks'; import { isLocal } from 'soapbox/utils/accounts'; @@ -127,8 +127,6 @@ const StatusActionBar: React.FC = ({ } else { onOpenUnauthorizedModal('REPLY'); } - - e.stopPropagation(); }; const handleShareClick = () => { @@ -146,18 +144,13 @@ const StatusActionBar: React.FC = ({ } else { onOpenUnauthorizedModal('FAVOURITE'); } - - e.stopPropagation(); }; const handleBookmarkClick: React.EventHandler = (e) => { - e.stopPropagation(); dispatch(toggleBookmark(status)); }; const handleReblogClick: React.EventHandler = e => { - e.stopPropagation(); - if (me) { const modalReblog = () => dispatch(toggleReblog(status)); const boostModal = settings.get('boostModal'); @@ -172,8 +165,6 @@ const StatusActionBar: React.FC = ({ }; const handleQuoteClick: React.EventHandler = (e) => { - e.stopPropagation(); - if (me) { dispatch(quoteCompose(status)); } else { @@ -199,12 +190,10 @@ const StatusActionBar: React.FC = ({ }; const handleDeleteClick: React.EventHandler = (e) => { - e.stopPropagation(); doDeleteStatus(); }; const handleRedraftClick: React.EventHandler = (e) => { - e.stopPropagation(); doDeleteStatus(true); }; @@ -213,35 +202,29 @@ const StatusActionBar: React.FC = ({ }; const handlePinClick: React.EventHandler = (e) => { - e.stopPropagation(); dispatch(togglePin(status)); }; const handleMentionClick: React.EventHandler = (e) => { - e.stopPropagation(); dispatch(mentionCompose(status.account as Account)); }; const handleDirectClick: React.EventHandler = (e) => { - e.stopPropagation(); dispatch(directCompose(status.account as Account)); }; const handleChatClick: React.EventHandler = (e) => { - e.stopPropagation(); const account = status.account as Account; dispatch(launchChat(account.id, history)); }; const handleMuteClick: React.EventHandler = (e) => { - e.stopPropagation(); dispatch(initMuteModal(status.account as Account)); }; const handleBlockClick: React.EventHandler = (e) => { - e.stopPropagation(); - const account = status.get('account') as Account; + dispatch(openModal('CONFIRM', { icon: require('@tabler/icons/ban.svg'), heading: , @@ -257,7 +240,6 @@ const StatusActionBar: React.FC = ({ }; const handleOpen: React.EventHandler = (e) => { - e.stopPropagation(); history.push(`/@${status.getIn(['account', 'acct'])}/posts/${status.id}`); }; @@ -269,12 +251,10 @@ const StatusActionBar: React.FC = ({ }; const handleReport: React.EventHandler = (e) => { - e.stopPropagation(); dispatch(initReport(status.account as Account, status)); }; const handleConversationMuteClick: React.EventHandler = (e) => { - e.stopPropagation(); dispatch(toggleMuteStatus(status)); }; @@ -282,8 +262,6 @@ const StatusActionBar: React.FC = ({ const { uri } = status; const textarea = document.createElement('textarea'); - e.stopPropagation(); - textarea.textContent = uri; textarea.style.position = 'fixed'; @@ -300,18 +278,15 @@ const StatusActionBar: React.FC = ({ }; const onModerate: React.MouseEventHandler = (e) => { - e.stopPropagation(); const account = status.account as Account; dispatch(openModal('ACCOUNT_MODERATION', { accountId: account.id })); }; const handleDeleteStatus: React.EventHandler = (e) => { - e.stopPropagation(); dispatch(deleteStatusModal(intl, status.id)); }; const handleToggleStatusSensitivity: React.EventHandler = (e) => { - e.stopPropagation(); dispatch(toggleStatusSensitivityModal(intl, status.id, status.sensitive)); }; @@ -550,74 +525,75 @@ const StatusActionBar: React.FC = ({ const canShare = ('share' in navigator) && status.visibility === 'public'; return ( -
- + + e.stopPropagation()} + > + - {(features.quotePosts && me) ? ( - - {reblogButton} - - ) : ( - reblogButton - )} + {(features.quotePosts && me) ? ( + + {reblogButton} + + ) : ( + reblogButton + )} - {features.emojiReacts ? ( - + {features.emojiReacts ? ( + + + + ) : ( - - ) : ( - - )} + )} - {canShare && ( - - )} + {canShare && ( + + )} - - - -
+ + + + + ); }; diff --git a/app/soapbox/components/ui/hstack/hstack.tsx b/app/soapbox/components/ui/hstack/hstack.tsx index 996320dea..996ccd64d 100644 --- a/app/soapbox/components/ui/hstack/hstack.tsx +++ b/app/soapbox/components/ui/hstack/hstack.tsx @@ -27,7 +27,7 @@ const spaces = { 8: 'space-x-8', }; -interface IHStack { +interface IHStack extends Pick, 'onClick'> { /** Vertical alignment of children. */ alignItems?: keyof typeof alignItemsOptions /** Extra class names on the
element. */