diff --git a/app/javascript/flavours/glitch/components/collapsable.js b/app/javascript/flavours/glitch/components/collapsable.js deleted file mode 100644 index 0e8b040332..0000000000 --- a/app/javascript/flavours/glitch/components/collapsable.js +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; -import Motion from 'flavours/glitch/util/optional_motion'; -import spring from 'react-motion/lib/spring'; -import PropTypes from 'prop-types'; - -const Collapsable = ({ fullHeight, isVisible, children }) => ( - - {({ opacity, height }) => - ( - {children} - ) - } - -); - -Collapsable.propTypes = { - fullHeight: PropTypes.number.isRequired, - isVisible: PropTypes.bool.isRequired, - children: PropTypes.node.isRequired, -}; - -export default Collapsable; diff --git a/app/javascript/flavours/glitch/features/composer/spoiler/index.js b/app/javascript/flavours/glitch/features/composer/spoiler/index.js index a49b0e10f4..d0e74b957f 100644 --- a/app/javascript/flavours/glitch/features/composer/spoiler/index.js +++ b/app/javascript/flavours/glitch/features/composer/spoiler/index.js @@ -3,9 +3,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import { defineMessages, FormattedMessage } from 'react-intl'; -// Components. -import Collapsable from 'flavours/glitch/components/collapsable'; - // Utils. import { assignHandlers, @@ -59,11 +56,8 @@ export default class ComposerSpoiler extends React.PureComponent { // The result. return ( - - + + @@ -76,7 +70,7 @@ export default class ComposerSpoiler extends React.PureComponent { value={text} /> - + ); } diff --git a/app/javascript/flavours/glitch/styles/components/composer.scss b/app/javascript/flavours/glitch/styles/components/composer.scss index dd21eae06c..0d46297a7b 100644 --- a/app/javascript/flavours/glitch/styles/components/composer.scss +++ b/app/javascript/flavours/glitch/styles/components/composer.scss @@ -2,7 +2,20 @@ padding: 10px; } +.no-reduce-motion .composer--spoiler { + transition: height 0.4s ease, opacity 0.4s ease; +} + .composer--spoiler { + height: 0; + transform-origin: bottom; + opacity: 0.0; + + &.composer--spoiler--visible { + height: 47px; + opacity: 1.0; + } + input { display: block; box-sizing: border-box;