2017-05-02 17:04:16 -07:00
|
|
|
import React from 'react';
|
2017-04-23 15:38:37 -07:00
|
|
|
import PropTypes from 'prop-types';
|
2017-12-03 23:26:40 -08:00
|
|
|
import Motion from 'flavours/glitch/util/optional_motion';
|
2017-10-05 18:46:15 -07:00
|
|
|
import spring from 'react-motion/lib/spring';
|
2017-04-23 15:38:37 -07:00
|
|
|
|
2017-06-23 10:36:54 -07:00
|
|
|
export default class Warning extends React.PureComponent {
|
2017-04-23 15:38:37 -07:00
|
|
|
|
2017-05-12 05:44:10 -07:00
|
|
|
static propTypes = {
|
2017-05-20 08:31:47 -07:00
|
|
|
message: PropTypes.node.isRequired,
|
2017-05-12 05:44:10 -07:00
|
|
|
};
|
2017-04-23 15:38:37 -07:00
|
|
|
|
|
|
|
render () {
|
|
|
|
const { message } = this.props;
|
|
|
|
|
|
|
|
return (
|
2017-10-01 03:20:00 -07:00
|
|
|
<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 }) }}>
|
|
|
|
{({ opacity, scaleX, scaleY }) => (
|
|
|
|
<div className='compose-form__warning' style={{ opacity: opacity, transform: `scale(${scaleX}, ${scaleY})` }}>
|
|
|
|
{message}
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</Motion>
|
2017-04-23 15:38:37 -07:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|