Use .destructive

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2021-11-08 17:21:33 +01:00
parent 0549c365e5
commit d25354013a
9 changed files with 19 additions and 19 deletions

View File

@ -148,10 +148,10 @@ class DropdownMenu extends React.PureComponent {
return <li key={`sep-${i}`} className='dropdown-menu__separator' />; return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
} }
const { text, href, to, newTab, isLogout, icon, type } = option; const { text, href, to, newTab, isLogout, icon, destructive } = option;
return ( return (
<li className={classNames('dropdown-menu__item', { warning: type === 'warning' })} key={`${text}-${i}`}> <li className={classNames('dropdown-menu__item', { destructive })} key={`${text}-${i}`}>
<a <a
href={href || to || '#'} href={href || to || '#'}
role='button' role='button'

View File

@ -364,13 +364,13 @@ class StatusActionBar extends ImmutablePureComponent {
text: intl.formatMessage(messages.delete), text: intl.formatMessage(messages.delete),
action: this.handleDeleteClick, action: this.handleDeleteClick,
icon: require('@tabler/icons/icons/trash.svg'), icon: require('@tabler/icons/icons/trash.svg'),
type: 'warning', destructive: true,
}); });
menu.push({ menu.push({
text: intl.formatMessage(messages.redraft), text: intl.formatMessage(messages.redraft),
action: this.handleRedraftClick, action: this.handleRedraftClick,
icon: require('@tabler/icons/icons/edit.svg'), icon: require('@tabler/icons/icons/edit.svg'),
type: 'warning', destructive: true,
}); });
} else { } else {
menu.push({ menu.push({
@ -443,13 +443,13 @@ class StatusActionBar extends ImmutablePureComponent {
text: intl.formatMessage(messages.deleteUser, { name: status.getIn(['account', 'username']) }), text: intl.formatMessage(messages.deleteUser, { name: status.getIn(['account', 'username']) }),
action: this.handleDeleteUser, action: this.handleDeleteUser,
icon: require('@tabler/icons/icons/user-minus.svg'), icon: require('@tabler/icons/icons/user-minus.svg'),
type: 'warning', destructive: true,
}); });
menu.push({ menu.push({
text: intl.formatMessage(messages.deleteStatus), text: intl.formatMessage(messages.deleteStatus),
action: this.handleDeleteStatus, action: this.handleDeleteStatus,
icon: require('@tabler/icons/icons/trash.svg'), icon: require('@tabler/icons/icons/trash.svg'),
type: 'warning', destructive: true,
}); });
} }
} }
@ -460,13 +460,13 @@ class StatusActionBar extends ImmutablePureComponent {
text: intl.formatMessage(messages.group_remove_account), text: intl.formatMessage(messages.group_remove_account),
action: this.handleGroupRemoveAccount, action: this.handleGroupRemoveAccount,
icon: require('@tabler/icons/icons/user-x.svg'), icon: require('@tabler/icons/icons/user-x.svg'),
type: 'warning', destructive: true,
}); });
menu.push({ menu.push({
text: intl.formatMessage(messages.group_remove_post), text: intl.formatMessage(messages.group_remove_post),
action: this.handleGroupRemovePost, action: this.handleGroupRemovePost,
icon: require('@tabler/icons/icons/trash.svg'), icon: require('@tabler/icons/icons/trash.svg'),
type: 'warning', destructive: true,
}); });
} }

View File

@ -37,7 +37,7 @@ class ReportStatus extends ImmutablePureComponent {
text: intl.formatMessage(messages.deleteStatus, { acct: `@${acct}` }), text: intl.formatMessage(messages.deleteStatus, { acct: `@${acct}` }),
action: this.handleDeleteStatus, action: this.handleDeleteStatus,
icon: require('@tabler/icons/icons/trash.svg'), icon: require('@tabler/icons/icons/trash.svg'),
type: 'warning', destructive: true,
}]; }];
} }

View File

@ -265,7 +265,7 @@ class ChatMessageList extends ImmutablePureComponent {
text: intl.formatMessage(messages.delete), text: intl.formatMessage(messages.delete),
action: this.handleDeleteMessage(chatMessage.get('chat_id'), chatMessage.get('id')), action: this.handleDeleteMessage(chatMessage.get('chat_id'), chatMessage.get('id')),
icon: require('@tabler/icons/icons/trash.svg'), icon: require('@tabler/icons/icons/trash.svg'),
type: 'warning', destructive: true,
}, },
{ {
text: intl.formatMessage(messages.report), text: intl.formatMessage(messages.report),

View File

@ -59,7 +59,7 @@ class Header extends ImmutablePureComponent {
text: intl.formatMessage(messages.removed_accounts), text: intl.formatMessage(messages.removed_accounts),
to: `/groups/${group.get('id')}/removed_accounts`, to: `/groups/${group.get('id')}/removed_accounts`,
icon: require('@tabler/icons/icons/trash.svg'), icon: require('@tabler/icons/icons/trash.svg'),
type: 'warning', destructive: true,
}, },
]; ];

View File

@ -367,13 +367,13 @@ class ActionBar extends React.PureComponent {
text: intl.formatMessage(messages.delete), text: intl.formatMessage(messages.delete),
action: this.handleDeleteClick, action: this.handleDeleteClick,
icon: require('@tabler/icons/icons/trash.svg'), icon: require('@tabler/icons/icons/trash.svg'),
type: 'warning', destructive: true,
}); });
menu.push({ menu.push({
text: intl.formatMessage(messages.redraft), text: intl.formatMessage(messages.redraft),
action: this.handleRedraftClick, action: this.handleRedraftClick,
icon: require('@tabler/icons/icons/edit.svg'), icon: require('@tabler/icons/icons/edit.svg'),
type: 'warning', destructive: true,
}); });
} else { } else {
menu.push({ menu.push({
@ -446,13 +446,13 @@ class ActionBar extends React.PureComponent {
text: intl.formatMessage(messages.deleteUser, { name: status.getIn(['account', 'username']) }), text: intl.formatMessage(messages.deleteUser, { name: status.getIn(['account', 'username']) }),
action: this.handleDeleteUser, action: this.handleDeleteUser,
icon: require('@tabler/icons/icons/user-minus.svg'), icon: require('@tabler/icons/icons/user-minus.svg'),
type: 'warning', destructive: true,
}); });
menu.push({ menu.push({
text: intl.formatMessage(messages.deleteStatus), text: intl.formatMessage(messages.deleteStatus),
action: this.handleDeleteStatus, action: this.handleDeleteStatus,
icon: require('@tabler/icons/icons/trash.svg'), icon: require('@tabler/icons/icons/trash.svg'),
type: 'warning', destructive: true,
}); });
} }
} }

View File

@ -28,7 +28,7 @@ class ActionsModal extends ImmutablePureComponent {
return <li key={`sep-${i}`} className='dropdown-menu__separator' />; return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
} }
const { icon = null, text, meta = null, active = false, href = '#', isLogout, type } = action; const { icon = null, text, meta = null, active = false, href = '#', isLogout, destructive } = action;
return ( return (
<li key={`${text}-${i}`}> <li key={`${text}-${i}`}>
@ -37,7 +37,7 @@ class ActionsModal extends ImmutablePureComponent {
rel='noopener' rel='noopener'
onClick={this.props.onClick} onClick={this.props.onClick}
data-index={i} data-index={i}
className={classNames({ active, warning: type === 'warning' })} className={classNames({ active, destructive })}
data-method={isLogout ? 'delete' : null} data-method={isLogout ? 'delete' : null}
> >
{icon && <Icon title={text} src={icon} role='presentation' tabIndex='-1' inverted />} {icon && <Icon title={text} src={icon} role='presentation' tabIndex='-1' inverted />}

View File

@ -69,7 +69,7 @@
color: var(--primary-text-color); color: var(--primary-text-color);
} }
&.warning a { &.destructive a {
color: var(--warning-color--hicontrast); color: var(--warning-color--hicontrast);
} }

View File

@ -581,7 +581,7 @@
transition: none; transition: none;
} }
&.warning { &.destructive {
color: var(--warning-color--hicontrast); color: var(--warning-color--hicontrast);
opacity: 1; opacity: 1;
} }