2019-04-20 22:05:09 +02:00
|
|
|
import PropTypes from 'prop-types';
|
2023-05-28 16:38:10 +02:00
|
|
|
import { PureComponent } from 'react';
|
|
|
|
|
2019-04-20 22:05:09 +02:00
|
|
|
import spring from 'react-motion/lib/spring';
|
|
|
|
|
2023-05-28 16:38:10 +02:00
|
|
|
import Motion from '../../ui/util/optional_motion';
|
|
|
|
|
|
|
|
|
2023-05-28 14:18:23 +02:00
|
|
|
export default class Warning extends PureComponent {
|
2019-04-20 22:05:09 +02: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 13:30:37 +01:00
|
|
|
<div className='compose-form__warning' style={{ opacity: opacity, transform: `scale(${scaleX}, ${scaleY})` }}>
|
2019-04-20 22:05:09 +02:00
|
|
|
{message}
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</Motion>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|