UNPKG

@uppy/informer

Version:

A notification and error pop-up bar for Uppy.

21 lines (20 loc) 746 B
import { jsx as _jsx } from "preact/jsx-runtime"; import { Component, createRef, h } from 'preact'; const TRANSITION_MS = 300; export default 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 (_jsx("div", { className: "uppy-Informer-animated", ref: this.ref, children: children })); } }