diff --git a/src/components/status-action-bar.tsx b/src/components/status-action-bar.tsx index 1e7737781..f4005a7b2 100644 --- a/src/components/status-action-bar.tsx +++ b/src/components/status-action-bar.tsx @@ -558,11 +558,13 @@ const StatusActionBar: React.FC = ({ action: handleMuteClick, icon: require('@tabler/icons/outline/volume-3.svg'), }); - menu.push({ - text: intl.formatMessage(messages.block, { name: username }), - action: handleBlockClick, - icon: require('@tabler/icons/outline/ban.svg'), - }); + if (features.blocks) { + menu.push({ + text: intl.formatMessage(messages.block, { name: username }), + action: handleBlockClick, + icon: require('@tabler/icons/outline/ban.svg'), + }); + } menu.push({ text: intl.formatMessage(messages.report, { name: username }), action: handleReport, diff --git a/src/features/account/components/header.tsx b/src/features/account/components/header.tsx index 786ce40c9..c5e361f6c 100644 --- a/src/features/account/components/header.tsx +++ b/src/features/account/components/header.tsx @@ -371,11 +371,13 @@ const Header: React.FC = ({ account }) => { to: '/mutes', icon: require('@tabler/icons/outline/circle-x.svg'), }); - menu.push({ - text: intl.formatMessage(messages.blocks), - to: '/blocks', - icon: require('@tabler/icons/outline/ban.svg'), - }); + if (features.blocks) { + menu.push({ + text: intl.formatMessage(messages.blocks), + to: '/blocks', + icon: require('@tabler/icons/outline/ban.svg'), + }); + } } else { menu.push({ text: intl.formatMessage(messages.mention, { name: account.username }), @@ -453,18 +455,20 @@ const Header: React.FC = ({ account }) => { }); } - if (account.relationship?.blocking) { - menu.push({ - text: intl.formatMessage(messages.unblock, { name: account.username }), - action: onBlock, - icon: require('@tabler/icons/outline/ban.svg'), - }); - } else { - menu.push({ - text: intl.formatMessage(messages.block, { name: account.username }), - action: onBlock, - icon: require('@tabler/icons/outline/ban.svg'), - }); + if (features.blocks) { + if (account.relationship?.blocking) { + menu.push({ + text: intl.formatMessage(messages.unblock, { name: account.username }), + action: onBlock, + icon: require('@tabler/icons/outline/ban.svg'), + }); + } else { + menu.push({ + text: intl.formatMessage(messages.block, { name: account.username }), + action: onBlock, + icon: require('@tabler/icons/outline/ban.svg'), + }); + } } menu.push({ diff --git a/src/features/settings/index.tsx b/src/features/settings/index.tsx index c3b26376f..51fcbcbbc 100644 --- a/src/features/settings/index.tsx +++ b/src/features/settings/index.tsx @@ -85,7 +85,7 @@ const Settings = () => { - + {features.blocks && ()} diff --git a/src/features/ui/components/modals/actions-modal.tsx b/src/features/ui/components/modals/actions-modal.tsx index 5fd37bab7..3b73f0a5f 100644 --- a/src/features/ui/components/modals/actions-modal.tsx +++ b/src/features/ui/components/modals/actions-modal.tsx @@ -23,30 +23,30 @@ const ActionsModal: React.FC = ({ status, actions, onClick, onClo const renderAction = (action: MenuItem | null, i: number) => { if (action === null) { return
  • ; - } - - const { icon = null, text, meta = null, active = false, href = '#', destructive } = action; + } else if (action.text !== 'Blocks') { + const { icon = null, text, meta = null, active = false, href = '#', destructive } = action; + + const Comp = href === '#' ? 'button' : 'a'; + const compProps = href === '#' ? { onClick: onClick } : { href: href, rel: 'noopener' }; - const Comp = href === '#' ? 'button' : 'a'; - const compProps = href === '#' ? { onClick: onClick } : { href: href, rel: 'noopener' }; - - return ( -
  • - - {icon && } -
    -
    {text}
    -
    {meta}
    -
    -
    -
  • - ); + return ( +
  • + + {icon && } +
    +
    {text}
    +
    {meta}
    +
    +
    +
  • + ); + } }; return (