about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/compose/containers/sensitive_button_container.js
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-05-10 17:59:57 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-05-10 17:59:57 +0200
commit6dc9baad2a0993bfec2612d4d85496b47725c219 (patch)
tree31fae8167ead3ba6639132224c81330251b07b71 /app/javascript/mastodon/features/compose/containers/sensitive_button_container.js
parent780d99c204df824fe959a3db00999f973a29c351 (diff)
Change icon and label depending on whether media is marked as sensitive (#10748)
* Change icon and label depending on whether media is marked as sensitive

* WiP use a checkbox
Diffstat (limited to 'app/javascript/mastodon/features/compose/containers/sensitive_button_container.js')
-rw-r--r--app/javascript/mastodon/features/compose/containers/sensitive_button_container.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/app/javascript/mastodon/features/compose/containers/sensitive_button_container.js b/app/javascript/mastodon/features/compose/containers/sensitive_button_container.js
index 50612b086..7073f76c2 100644
--- a/app/javascript/mastodon/features/compose/containers/sensitive_button_container.js
+++ b/app/javascript/mastodon/features/compose/containers/sensitive_button_container.js
@@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
 import classNames from 'classnames';
 import { changeComposeSensitivity } from 'mastodon/actions/compose';
 import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
-import Icon from 'mastodon/components/icon';
 
 const messages = defineMessages({
   marked: { id: 'compose_form.sensitive.marked', defaultMessage: 'Media is marked as sensitive' },
@@ -38,9 +37,19 @@ class SensitiveButton extends React.PureComponent {
 
     return (
       <div className='compose-form__sensitive-button'>
-        <button className={classNames('icon-button', { active })} onClick={onClick} disabled={disabled} title={intl.formatMessage(active ? messages.marked : messages.unmarked)}>
-          <Icon id='eye-slash' /> <FormattedMessage id='compose_form.sensitive.hide' defaultMessage='Mark media as sensitive' />
-        </button>
+        <label className={classNames('icon-button', { active })} title={intl.formatMessage(active ? messages.marked : messages.unmarked)}>
+          <input
+            name='mark-sensitive'
+            type='checkbox'
+            checked={active}
+            onChange={onClick}
+            disabled={disabled}
+          />
+
+          <span className={classNames('checkbox', { active })} />
+
+          <FormattedMessage id='compose_form.sensitive.hide' defaultMessage='Mark media as sensitive' />
+        </label>
       </div>
     );
   }