1234567891011121314151617181920212223242526272829 |
- const { h, Component, createRef } = require('preact')
- const TRANSITION_MS = 300
- module.exports = class FadeIn extends Component {
- ref = createRef();
- componentWillEnter (callback) {
- this.ref.current.style.opacity = '1'
- this.ref.current.style.transform = 'none'
- setTimeout(callback, TRANSITION_MS)
- }
- componentWillLeave (callback) {
- this.ref.current.style.opacity = '0'
- this.ref.current.style.transform = 'translateY(350%)'
- setTimeout(callback, TRANSITION_MS)
- }
- render () {
- const { children } = this.props
- return (
- <div className="uppy-Informer-animated" ref={this.ref}>
- {children}
- </div>
- )
- }
- }
|