diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-08-15 21:41:55 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:45:18 -0500 |
commit | cc29f25b87d44daf5da2d3ef702ea29a333630b5 (patch) | |
tree | 5090a5129f9deb6b5f982dd4feb8dd3fad1f3ac1 /app/javascript/flavours/glitch/features/compose/components/publisher.js | |
parent | 2fa9ed909c5ccd744779ed5dbe9fedc7259df24f (diff) |
[UI] Non-destructive conversion of reply to non-reply, add clear button
Diffstat (limited to 'app/javascript/flavours/glitch/features/compose/components/publisher.js')
-rw-r--r-- | app/javascript/flavours/glitch/features/compose/components/publisher.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/compose/components/publisher.js b/app/javascript/flavours/glitch/features/compose/components/publisher.js index 107c7fa91..08318ab6d 100644 --- a/app/javascript/flavours/glitch/features/compose/components/publisher.js +++ b/app/javascript/flavours/glitch/features/compose/components/publisher.js @@ -23,6 +23,10 @@ const messages = defineMessages({ defaultMessage: '{publish}!', id: 'compose_form.publish_loud', }, + clear: { + defaultMessage: 'Clear', + id: 'compose_form.clear', + }, }); export default @injectIntl @@ -34,6 +38,7 @@ class Publisher extends ImmutablePureComponent { intl: PropTypes.object.isRequired, onSecondarySubmit: PropTypes.func, onSubmit: PropTypes.func, + onClearAll: PropTypes.func, privacy: PropTypes.oneOf(['direct', 'private', 'unlisted', 'public']), privacyWarning: PropTypes.bool, sideArm: PropTypes.oneOf(['none', 'direct', 'private', 'unlisted', 'public']), @@ -45,7 +50,7 @@ class Publisher extends ImmutablePureComponent { }; render () { - const { countText, disabled, intl, onSecondarySubmit, privacy, privacyWarning, sideArm, sideArmWarning } = this.props; + const { countText, disabled, intl, onClearAll, onSecondarySubmit, privacy, privacyWarning, sideArm, sideArmWarning } = this.props; const diff = maxChars - length(countText || ''); const computedClass = classNames('composer--publisher', { @@ -55,6 +60,17 @@ class Publisher extends ImmutablePureComponent { return ( <div className={computedClass}> + <Button + className='clear' + onClick={onClearAll} + style={{ padding: null }} + title={intl.formatMessage(messages.clear)} + text={ + <span> + <Icon id='trash-o' /> + </span> + } + /> {sideArm && sideArm !== 'none' ? ( <Button className={classNames('side_arm', {privacy_warning: sideArmWarning})} |