]> cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/features/compose/components/warning.js
Merge pull request #223 from glitch-soc/glitchsoc/feature/configurable-status-size
[mastodon.git] / app / javascript / mastodon / features / compose / components / warning.js
1 import React from 'react';
2 import PropTypes from 'prop-types';
3 import Motion from '../../ui/util/optional_motion';
4 import spring from 'react-motion/lib/spring';
5
6 export default class Warning extends React.PureComponent {
7
8 static propTypes = {
9 message: PropTypes.node.isRequired,
10 };
11
12 render () {
13 const { message } = this.props;
14
15 return (
16 <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 }) }}>
17 {({ opacity, scaleX, scaleY }) => (
18 <div className='compose-form__warning' style={{ opacity: opacity, transform: `scale(${scaleX}, ${scaleY})` }}>
19 {message}
20 </div>
21 )}
22 </Motion>
23 );
24 }
25
26 }
This page took 0.106538 seconds and 4 git commands to generate.