logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

warning.js (841B)


  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import Motion from '../../ui/util/optional_motion';
  4. import spring from 'react-motion/lib/spring';
  5. export default class Warning extends React.PureComponent {
  6. static propTypes = {
  7. message: PropTypes.node.isRequired,
  8. };
  9. render () {
  10. const { message } = this.props;
  11. return (
  12. <Motion defaultStyle={{ opacity: 0, scaleX: 0.85, scaleY: 0.75 }} style={{ opacity: spring(1, { damping: 35, stiffness: 400 }), scaleX: spring(1, { damping: 35, stiffness: 400 }), scaleY: spring(1, { damping: 35, stiffness: 400 }) }}>
  13. {({ opacity, scaleX, scaleY }) => (
  14. <div className='compose-form__warning' style={{ opacity: opacity, transform: `scale(${scaleX}, ${scaleY})` }}>
  15. {message}
  16. </div>
  17. )}
  18. </Motion>
  19. );
  20. }
  21. }