File tree Expand file tree Collapse file tree
mastodon/features/compose/containers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
44import classNames from 'classnames' ;
55import { changeComposeSensitivity } from 'mastodon/actions/compose' ;
66import { injectIntl , defineMessages , FormattedMessage } from 'react-intl' ;
7- import Icon from 'mastodon/components/icon' ;
87
98const messages = defineMessages ( {
109 marked : { id : 'compose_form.sensitive.marked' , defaultMessage : 'Media is marked as sensitive' } ,
@@ -38,9 +37,19 @@ class SensitiveButton extends React.PureComponent {
3837
3938 return (
4039 < div className = 'compose-form__sensitive-button' >
41- < button className = { classNames ( 'icon-button' , { active } ) } onClick = { onClick } disabled = { disabled } title = { intl . formatMessage ( active ? messages . marked : messages . unmarked ) } >
42- < Icon id = 'eye-slash' /> < FormattedMessage id = 'compose_form.sensitive.hide' defaultMessage = 'Mark media as sensitive' />
43- </ button >
40+ < label className = { classNames ( 'icon-button' , { active } ) } title = { intl . formatMessage ( active ? messages . marked : messages . unmarked ) } >
41+ < input
42+ name = 'mark-sensitive'
43+ type = 'checkbox'
44+ checked = { active }
45+ onChange = { onClick }
46+ disabled = { disabled }
47+ />
48+
49+ < span className = { classNames ( 'checkbox' , { active } ) } />
50+
51+ < FormattedMessage id = 'compose_form.sensitive.hide' defaultMessage = 'Mark media as sensitive' />
52+ </ label >
4453 </ div >
4554 ) ;
4655 }
Original file line number Diff line number Diff line change 268268 padding : 10px ;
269269 padding-top : 0 ;
270270
271- .icon-button {
272- font-size : 14px ;
273- font-weight : 500 ;
271+ font-size : 14px ;
272+ font-weight : 500 ;
273+
274+ & .active {
275+ color : $highlight-text-color ;
276+ }
277+
278+ input [type = checkbox ] {
279+ display : none ;
280+ }
281+
282+ .checkbox {
283+ display : inline-block ;
284+ position : relative ;
285+ border : 1px solid $ui-primary-color ;
286+ box-sizing : border-box ;
287+ width : 18px ;
288+ height : 18px ;
289+ flex : 0 0 auto ;
290+ margin-right : 10px ;
291+ top : -1px ;
292+ border-radius : 4px ;
293+ vertical-align : middle ;
294+
295+ & .active {
296+ border-color : $highlight-text-color ;
297+ background : $highlight-text-color ;
298+ }
274299 }
275300 }
276301
You can’t perform that action at this time.
0 commit comments