umami/components/common/Modal.js
2020-08-07 02:27:12 -07:00

17 lines
506 B
JavaScript

import React from 'react';
import { useSpring, animated } from 'react-spring';
import styles from './Modal.module.css';
export default function Modal({ title, children }) {
const props = useSpring({ opacity: 1, from: { opacity: 0 } });
return (
<animated.div className={styles.modal} style={props}>
<div className={styles.content}>
{title && <div className={styles.header}>{title}</div>}
<div className={styles.body}>{children}</div>
</div>
</animated.div>
);
}