diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-07-12 13:13:05 +0200 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:45:15 -0500 |
commit | 00dc6609700d2d26a42cdb2944052a826ffcbc1d (patch) | |
tree | df387b96b8bbd053b55b57df544cd41ca3a93c04 /app/javascript/flavours/glitch/features/compose/components/publisher.js | |
parent | 0ed210cd5b8c6d3b743fd0e320c4705fa6a08d34 (diff) |
[Privacy, UI, Port: glitch-soc@b8b6f1d] Change secondary and primary toot button color when it may reduce privacy
Co-authored-by: Fire Demon <firedemon@creature.cafe>
Diffstat (limited to 'app/javascript/flavours/glitch/features/compose/components/publisher.js')
-rw-r--r-- | app/javascript/flavours/glitch/features/compose/components/publisher.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/features/compose/components/publisher.js b/app/javascript/flavours/glitch/features/compose/components/publisher.js index 97890f40d..107c7fa91 100644 --- a/app/javascript/flavours/glitch/features/compose/components/publisher.js +++ b/app/javascript/flavours/glitch/features/compose/components/publisher.js @@ -35,7 +35,9 @@ class Publisher extends ImmutablePureComponent { onSecondarySubmit: PropTypes.func, onSubmit: PropTypes.func, privacy: PropTypes.oneOf(['direct', 'private', 'unlisted', 'public']), + privacyWarning: PropTypes.bool, sideArm: PropTypes.oneOf(['none', 'direct', 'private', 'unlisted', 'public']), + sideArmWarning: PropTypes.bool, }; handleSubmit = () => { @@ -43,7 +45,7 @@ class Publisher extends ImmutablePureComponent { }; render () { - const { countText, disabled, intl, onSecondarySubmit, privacy, sideArm } = this.props; + const { countText, disabled, intl, onSecondarySubmit, privacy, privacyWarning, sideArm, sideArmWarning } = this.props; const diff = maxChars - length(countText || ''); const computedClass = classNames('composer--publisher', { @@ -55,7 +57,7 @@ class Publisher extends ImmutablePureComponent { <div className={computedClass}> {sideArm && sideArm !== 'none' ? ( <Button - className='side_arm' + className={classNames('side_arm', {privacy_warning: sideArmWarning})} disabled={disabled || diff < 0} onClick={onSecondarySubmit} style={{ padding: null }} @@ -75,7 +77,7 @@ class Publisher extends ImmutablePureComponent { /> ) : null} <Button - className='primary' + className={classNames('primary', {privacy_warning: privacyWarning})} text={function () { switch (true) { case !!sideArm && sideArm !== 'none': |