Change the title of sensitive button by state (#6771)
Icon showing the state may be confusing. (does the slahed eye icon mean the state that it is sensitive, or to mark it as sensitive?) Moreover, it may not help for blind people. The title will give the precise representation of the current state.
This commit is contained in:
parent
386365090c
commit
18241ccbe1
39 changed files with 83 additions and 41 deletions
|
@ -9,7 +9,8 @@ import spring from 'react-motion/lib/spring';
|
|||
import { injectIntl, defineMessages } from 'react-intl';
|
||||
|
||||
const messages = defineMessages({
|
||||
title: { id: 'compose_form.sensitive', defaultMessage: 'Mark media as sensitive' },
|
||||
marked: { id: 'compose_form.sensitive.marked', defaultMessage: 'Media is marked as sensitive' },
|
||||
unmarked: { id: 'compose_form.sensitive.unmarked', defaultMessage: 'Media is not marked as sensitive' },
|
||||
});
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
|
@ -50,7 +51,7 @@ class SensitiveButton extends React.PureComponent {
|
|||
<div className={className} style={{ transform: `scale(${scale})` }}>
|
||||
<IconButton
|
||||
className='compose-form__sensitive-button__icon'
|
||||
title={intl.formatMessage(messages.title)}
|
||||
title={intl.formatMessage(active ? messages.marked : messages.unmarked)}
|
||||
icon={icon}
|
||||
onClick={onClick}
|
||||
size={18}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue