kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Hidden blocks button
rodzic
d67b10a376
commit
ec594e7c96
|
@ -558,11 +558,13 @@ const StatusActionBar: React.FC<IStatusActionBar> = ({
|
|||
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,
|
||||
|
|
|
@ -371,11 +371,13 @@ const Header: React.FC<IHeader> = ({ 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<IHeader> = ({ 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({
|
||||
|
|
|
@ -85,7 +85,7 @@ const Settings = () => {
|
|||
<CardBody>
|
||||
<List>
|
||||
<ListItem label={intl.formatMessage(messages.mutes)} to='/mutes' />
|
||||
<ListItem label={intl.formatMessage(messages.blocks)} to='/blocks' />
|
||||
{features.blocks && (<ListItem label={intl.formatMessage(messages.blocks)} to='/blocks' />)}
|
||||
</List>
|
||||
</CardBody>
|
||||
|
||||
|
|
|
@ -23,30 +23,30 @@ const ActionsModal: React.FC<IActionsModal> = ({ status, actions, onClick, onClo
|
|||
const renderAction = (action: MenuItem | null, i: number) => {
|
||||
if (action === null) {
|
||||
return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
|
||||
} 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' };
|
||||
|
||||
return (
|
||||
<li key={`${text}-${i}`}>
|
||||
<HStack
|
||||
{...compProps}
|
||||
space={2.5}
|
||||
data-index={i}
|
||||
className={clsx('w-full', { active, destructive })}
|
||||
element={Comp}
|
||||
>
|
||||
{icon && <Icon title={text} src={icon} role='presentation' tabIndex={-1} />}
|
||||
<div>
|
||||
<div className={clsx({ 'actions-modal__item-label': !!meta })}>{text}</div>
|
||||
<div>{meta}</div>
|
||||
</div>
|
||||
</HStack>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
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' };
|
||||
|
||||
return (
|
||||
<li key={`${text}-${i}`}>
|
||||
<HStack
|
||||
{...compProps}
|
||||
space={2.5}
|
||||
data-index={i}
|
||||
className={clsx('w-full', { active, destructive })}
|
||||
element={Comp}
|
||||
>
|
||||
{icon && <Icon title={text} src={icon} role='presentation' tabIndex={-1} />}
|
||||
<div>
|
||||
<div className={clsx({ 'actions-modal__item-label': !!meta })}>{text}</div>
|
||||
<div>{meta}</div>
|
||||
</div>
|
||||
</HStack>
|
||||
</li>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
Ładowanie…
Reference in New Issue