You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
844 B

  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import Motion from 'flavours/glitch/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='composer--warning' style={{ opacity: opacity, transform: `scale(${scaleX}, ${scaleY})` }}>
  15. {message}
  16. </div>
  17. )}
  18. </Motion>
  19. );
  20. }
  21. }