const mapStateToProps = state => ({
visible: state.getIn(['compose', 'media_attachments']).size > 0,
active: state.getIn(['compose', 'sensitive']),
+ disabled: state.getIn(['compose', 'spoiler']),
});
const mapDispatchToProps = dispatch => ({
static propTypes = {
visible: PropTypes.bool,
active: PropTypes.bool,
+ disabled: PropTypes.bool,
onClick: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
};
render () {
- const { visible, active, onClick, intl } = this.props;
+ const { visible, active, disabled, onClick, intl } = this.props;
return (
<Motion defaultStyle={{ scale: 0.87 }} style={{ scale: spring(visible ? 1 : 0.87, { stiffness: 200, damping: 3 }) }}>
onClick={onClick}
size={18}
active={active}
+ disabled={disabled}
style={{ lineHeight: null, height: null }}
inverted
/>
.set('mounted', false)
.set('is_composing', false);
case COMPOSE_SENSITIVITY_CHANGE:
- return state
- .set('sensitive', !state.get('sensitive'))
- .set('idempotencyKey', uuid());
+ return state.withMutations(map => {
+ if (!state.get('spoiler')) {
+ map.set('sensitive', !state.get('sensitive'));
+ }
+
+ map.set('idempotencyKey', uuid());
+ });
case COMPOSE_SPOILERNESS_CHANGE:
return state.withMutations(map => {
map.set('spoiler_text', '');
color: $ui-base-lighter-color;
}
+ &.disabled {
+ color: $ui-primary-color;
+ }
+
&.active {
color: $ui-highlight-color;
- }
- &.disabled {
- color: $ui-primary-color;
+ &.disabled {
+ color: lighten($ui-highlight-color, 13%);
+ }
}
}