2023-05-23 17:52:27 +09:00
|
|
|
import { PureComponent } from 'react';
|
2017-04-24 07:38:37 +09:00
|
|
|
import PropTypes from 'prop-types';
|
2017-10-16 16:36:15 +09:00
|
|
|
import Motion from '../../ui/util/optional_motion';
|
2017-10-06 10:46:15 +09:00
|
|
|
import spring from 'react-motion/lib/spring';
|
2017-04-24 07:38:37 +09:00
|
|
|
|
2023-05-23 17:52:27 +09:00
|
|
|
export default class Warning extends PureComponent {
|
2017-04-24 07:38:37 +09:00
|
|
|
|
2017-05-12 21:44:10 +09:00
|
|
|
static propTypes = {
|
2017-05-21 00:31:47 +09:00
|
|
|
message: PropTypes.node.isRequired,
|
2017-05-12 21:44:10 +09:00
|
|
|
};
|
2017-04-24 07:38:37 +09:00
|
|
|
|
|
|
|
render () {
|
|
|
|
const { message } = this.props;
|
|
|
|
|
|
|
|
return (
|
2017-10-01 19:20:00 +09: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-24 07:38:37 +09:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|