mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
feature(components): prop-type Modal
This commit is contained in:
parent
cf87ec1ea5
commit
de18b03803
@ -1,9 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import { useSpring, animated } from 'react-spring';
|
import { useSpring, animated } from 'react-spring';
|
||||||
import styles from './Modal.module.css';
|
import styles from './Modal.module.css';
|
||||||
|
|
||||||
export default function Modal({ title, children }) {
|
function Modal({ title, children }) {
|
||||||
const props = useSpring({ opacity: 1, from: { opacity: 0 } });
|
const props = useSpring({ opacity: 1, from: { opacity: 0 } });
|
||||||
|
|
||||||
return ReactDOM.createPortal(
|
return ReactDOM.createPortal(
|
||||||
@ -16,3 +17,10 @@ export default function Modal({ title, children }) {
|
|||||||
document.getElementById('__modals'),
|
document.getElementById('__modals'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Modal.propTypes = {
|
||||||
|
title: PropTypes.node,
|
||||||
|
children: PropTypes.node,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Modal;
|
||||||
|
Loading…
Reference in New Issue
Block a user