From 00dc6609700d2d26a42cdb2944052a826ffcbc1d Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Thu, 12 Jul 2018 13:13:05 +0200 Subject: [Privacy, UI, 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(-) (limited to 'app/javascript') 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 ad1878115..adaf063ee 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, @@ -273,9 +275,11 @@ class ComposeForm extends ImmutablePureComponent { onFetchSuggestions, onPaste, privacy, + privacyWarning, sensitive, showSearch, sideArm, + sideArmWarning, spoiler, spoilerText, suggestions, @@ -357,7 +361,9 @@ class ComposeForm extends ImmutablePureComponent { onSecondarySubmit={handleSecondarySubmit} onSubmit={handleSubmit} 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 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 {
{sideArm && sideArm !== 'none' ? (