2023-05-28 12:18:23 +00:00
|
|
|
import { PureComponent } from 'react';
|
2019-04-20 20:05:09 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2022-10-11 08:51:33 +00:00
|
|
|
import Motion from '../../ui/util/optional_motion';
|
2019-04-20 20:05:09 +00:00
|
|
|
import spring from 'react-motion/lib/spring';
|
|
|
|
|
2023-05-28 12:18:23 +00:00
|
|
|
export default class Warning extends PureComponent {
|
2019-04-20 20:05:09 +00:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
message: PropTypes.node.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
render () {
|
|
|
|
const { message } = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<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 }) => (
|
2022-11-06 12:30:37 +00:00
|
|
|
<div className='compose-form__warning' style={{ opacity: opacity, transform: `scale(${scaleX}, ${scaleY})` }}>
|
2019-04-20 20:05:09 +00:00
|
|
|
{message}
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</Motion>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|