From 2d0e20ed990be8e6f537b2b19650a18cad7503c6 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Thu, 12 Jul 2018 13:13:05 +0200 Subject: [Port: glitch-soc@b8b6f1d] Change secondary and primary toot button color when it may reduce privacy Co-authored-by: Fire Demon --- .../glitch/features/compose/components/compose_form.js | 6 ++++++ .../glitch/features/compose/components/publisher.js | 8 +++++--- .../features/compose/containers/compose_form_container.js | 4 +++- .../flavours/glitch/styles/components/composer.scss | 13 +++++++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index 1c05fdafc..efb2528df 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -63,6 +63,8 @@ class ComposeForm extends ImmutablePureComponent { layout: PropTypes.string, media: ImmutablePropTypes.list, sideArm: PropTypes.string, + sideArmWarning: PropTypes.bool, + privacyWarning: PropTypes.bool, sensitive: PropTypes.bool, spoilersAlwaysOn: PropTypes.bool, mediaDescriptionConfirmation: PropTypes.bool, @@ -287,9 +289,11 @@ class ComposeForm extends ImmutablePureComponent { onFetchSuggestions, onPaste, privacy, + privacyWarning, sensitive, showSearch, sideArm, + sideArmWarning, spoiler, spoilerText, suggestions, @@ -373,7 +377,9 @@ class ComposeForm extends ImmutablePureComponent { onSubmit={handleSubmit} onClearAll={handleClearAll} privacy={privacy} + privacyWarning={privacyWarning} sideArm={sideArm} + sideArmWarning={sideArmWarning} /> ); diff --git a/app/javascript/flavours/glitch/features/compose/components/publisher.js b/app/javascript/flavours/glitch/features/compose/components/publisher.js index e5a3d023f..d42c578aa 100644 --- a/app/javascript/flavours/glitch/features/compose/components/publisher.js +++ b/app/javascript/flavours/glitch/features/compose/components/publisher.js @@ -40,7 +40,9 @@ class Publisher extends ImmutablePureComponent { onSubmit: PropTypes.func, onClearAll: PropTypes.func, privacy: PropTypes.oneOf(['direct', 'private', 'unlisted', 'public']), + privacyWarning: PropTypes.bool, sideArm: PropTypes.oneOf(['none', 'direct', 'private', 'unlisted', 'public']), + sideArmWarning: PropTypes.bool, }; handleSubmit = () => { @@ -48,7 +50,7 @@ class Publisher extends ImmutablePureComponent { }; render () { - const { countText, disabled, intl, onClearAll, onSecondarySubmit, privacy, sideArm } = this.props; + const { countText, disabled, intl, onClearAll, onSecondarySubmit, privacy, privacyWarning, sideArm, sideArmWarning } = this.props; const diff = maxChars - length(countText || ''); const computedClass = classNames('composer--publisher', { @@ -71,7 +73,7 @@ class Publisher extends ImmutablePureComponent { /> {sideArm && sideArm !== 'none' ? (