From 1287b2782b8e8a1d2c7a3684ebf1327fc5647f51 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Fri, 19 Jan 2018 11:34:48 +0100 Subject: Display a warning when composing unlisted toots with something looking like a hashtag This is a backport of b6af88192ff48372c5f6ed1321f21d99aaffcd3f to the glitch flavour. --- .../features/composer/hashtag_warning/index.js | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 app/javascript/flavours/glitch/features/composer/hashtag_warning/index.js (limited to 'app/javascript/flavours/glitch/features/composer/hashtag_warning/index.js') diff --git a/app/javascript/flavours/glitch/features/composer/hashtag_warning/index.js b/app/javascript/flavours/glitch/features/composer/hashtag_warning/index.js new file mode 100644 index 000000000..716028e4c --- /dev/null +++ b/app/javascript/flavours/glitch/features/composer/hashtag_warning/index.js @@ -0,0 +1,49 @@ +import React from 'react'; +import Motion from 'flavours/glitch/util/optional_motion'; +import spring from 'react-motion/lib/spring'; +import { defineMessages, FormattedMessage } from 'react-intl'; + +// This is the spring used with our motion. +const motionSpring = spring(1, { damping: 35, stiffness: 400 }); + +// Messages. +const messages = defineMessages({ + disclaimer: { + defaultMessage: 'This toot won\'t be listed under any hashtag as it is unlisted. Only public toots can be searched by hashtag.', + id: 'compose_form.hashtag_warning', + }, +}); + +// The component. +export default function ComposerHashtagWarning () { + return ( + + {({ opacity, scaleX, scaleY }) => ( +
+ +
+ )} +
+ ); +} + +ComposerHashtagWarning.propTypes = {}; -- cgit