sforkowany z mirror/soapbox
Use warning color for delete actions
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>features-override
rodzic
b65b44be62
commit
287bd6c7f5
|
@ -1,4 +1,5 @@
|
|||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import IconButton from './icon_button';
|
||||
|
@ -147,10 +148,10 @@ class DropdownMenu extends React.PureComponent {
|
|||
return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
|
||||
}
|
||||
|
||||
const { text, href, to, newTab, isLogout, icon } = option;
|
||||
const { text, href, to, newTab, isLogout, icon, type } = option;
|
||||
|
||||
return (
|
||||
<li className='dropdown-menu__item' key={`${text}-${i}`}>
|
||||
<li className={classNames('dropdown-menu__item', { warning: type === 'warning' })} key={`${text}-${i}`}>
|
||||
<a
|
||||
href={href || to || '#'}
|
||||
role='button'
|
||||
|
|
|
@ -364,11 +364,13 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||
text: intl.formatMessage(messages.delete),
|
||||
action: this.handleDeleteClick,
|
||||
icon: require('@tabler/icons/icons/trash.svg'),
|
||||
type: 'warning',
|
||||
});
|
||||
menu.push({
|
||||
text: intl.formatMessage(messages.redraft),
|
||||
action: this.handleRedraftClick,
|
||||
icon: require('@tabler/icons/icons/edit.svg'),
|
||||
type: 'warning',
|
||||
});
|
||||
} else {
|
||||
menu.push({
|
||||
|
@ -441,11 +443,13 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||
text: intl.formatMessage(messages.deleteUser, { name: status.getIn(['account', 'username']) }),
|
||||
action: this.handleDeleteUser,
|
||||
icon: require('@tabler/icons/icons/user-minus.svg'),
|
||||
type: 'warning',
|
||||
});
|
||||
menu.push({
|
||||
text: intl.formatMessage(messages.deleteStatus),
|
||||
action: this.handleDeleteStatus,
|
||||
icon: require('@tabler/icons/icons/trash.svg'),
|
||||
type: 'warning',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -456,11 +460,13 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||
text: intl.formatMessage(messages.group_remove_account),
|
||||
action: this.handleGroupRemoveAccount,
|
||||
icon: require('@tabler/icons/icons/user-x.svg'),
|
||||
type: 'warning',
|
||||
});
|
||||
menu.push({
|
||||
text: intl.formatMessage(messages.group_remove_post),
|
||||
action: this.handleGroupRemovePost,
|
||||
icon: require('@tabler/icons/icons/trash.svg'),
|
||||
type: 'warning',
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ class ReportStatus extends ImmutablePureComponent {
|
|||
text: intl.formatMessage(messages.deleteStatus, { acct: `@${acct}` }),
|
||||
action: this.handleDeleteStatus,
|
||||
icon: require('@tabler/icons/icons/trash.svg'),
|
||||
type: 'warning',
|
||||
}];
|
||||
}
|
||||
|
||||
|
|
|
@ -265,6 +265,7 @@ class ChatMessageList extends ImmutablePureComponent {
|
|||
text: intl.formatMessage(messages.delete),
|
||||
action: this.handleDeleteMessage(chatMessage.get('chat_id'), chatMessage.get('id')),
|
||||
icon: require('@tabler/icons/icons/trash.svg'),
|
||||
type: 'warning',
|
||||
},
|
||||
{
|
||||
text: intl.formatMessage(messages.report),
|
||||
|
|
|
@ -59,6 +59,7 @@ class Header extends ImmutablePureComponent {
|
|||
text: intl.formatMessage(messages.removed_accounts),
|
||||
to: `/groups/${group.get('id')}/removed_accounts`,
|
||||
icon: require('@tabler/icons/icons/trash.svg'),
|
||||
type: 'warning',
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
@ -367,11 +367,13 @@ class ActionBar extends React.PureComponent {
|
|||
text: intl.formatMessage(messages.delete),
|
||||
action: this.handleDeleteClick,
|
||||
icon: require('@tabler/icons/icons/trash.svg'),
|
||||
type: 'warning',
|
||||
});
|
||||
menu.push({
|
||||
text: intl.formatMessage(messages.redraft),
|
||||
action: this.handleRedraftClick,
|
||||
icon: require('@tabler/icons/icons/edit.svg'),
|
||||
type: 'warning',
|
||||
});
|
||||
} else {
|
||||
menu.push({
|
||||
|
@ -444,11 +446,13 @@ class ActionBar extends React.PureComponent {
|
|||
text: intl.formatMessage(messages.deleteUser, { name: status.getIn(['account', 'username']) }),
|
||||
action: this.handleDeleteUser,
|
||||
icon: require('@tabler/icons/icons/user-minus.svg'),
|
||||
type: 'warning',
|
||||
});
|
||||
menu.push({
|
||||
text: intl.formatMessage(messages.deleteStatus),
|
||||
action: this.handleDeleteStatus,
|
||||
icon: require('@tabler/icons/icons/trash.svg'),
|
||||
type: 'warning',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class ActionsModal extends ImmutablePureComponent {
|
|||
return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
|
||||
}
|
||||
|
||||
const { icon = null, text, meta = null, active = false, href = '#', isLogout } = action;
|
||||
const { icon = null, text, meta = null, active = false, href = '#', isLogout, type } = action;
|
||||
|
||||
return (
|
||||
<li key={`${text}-${i}`}>
|
||||
|
@ -37,7 +37,7 @@ class ActionsModal extends ImmutablePureComponent {
|
|||
rel='noopener'
|
||||
onClick={this.props.onClick}
|
||||
data-index={i}
|
||||
className={classNames({ active })}
|
||||
className={classNames({ active, warning: type === 'warning' })}
|
||||
data-method={isLogout ? 'delete' : null}
|
||||
>
|
||||
{icon && <Icon title={text} src={icon} role='presentation' tabIndex='-1' inverted />}
|
||||
|
|
|
@ -55,39 +55,48 @@
|
|||
padding: 6px 0;
|
||||
}
|
||||
|
||||
&__item a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
padding: 4px 10px;
|
||||
font-size: 15px;
|
||||
text-decoration: none;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: var(--primary-text-color);
|
||||
|
||||
&:focus,
|
||||
&:hover,
|
||||
&:active {
|
||||
outline: 0;
|
||||
color: #fff;
|
||||
background: var(--brand-color) !important;
|
||||
|
||||
* {
|
||||
color: #fff;
|
||||
}
|
||||
&__item {
|
||||
a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
padding: 4px 10px;
|
||||
font-size: 15px;
|
||||
text-decoration: none;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: var(--primary-text-color);
|
||||
}
|
||||
|
||||
.svg-icon:first-child {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
margin-right: 10px;
|
||||
transition: none;
|
||||
&.warning a {
|
||||
color: var(--warning-color);
|
||||
}
|
||||
|
||||
svg {
|
||||
stroke-width: 1.5;
|
||||
a {
|
||||
&:focus,
|
||||
&:hover,
|
||||
&:active {
|
||||
outline: 0;
|
||||
color: #fff;
|
||||
background: var(--brand-color) !important;
|
||||
|
||||
* {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.svg-icon:first-child {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
min-width: 20px;
|
||||
margin-right: 10px;
|
||||
transition: none;
|
||||
|
||||
svg {
|
||||
stroke-width: 1.5;
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -581,6 +581,11 @@
|
|||
transition: none;
|
||||
}
|
||||
|
||||
&.warning {
|
||||
color: var(--warning-color);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&.active,
|
||||
&:hover,
|
||||
&:focus {
|
||||
|
|
Ładowanie…
Reference in New Issue