UNPKG

mdc-react

Version:

Material Components for the web implemented in React

31 lines (26 loc) 620 B
import { CSSTransition } from 'react-transition-group'; import PropTypes from 'prop-types'; import Modal from '../modal'; export default function Layer({ modal = false, fixed = false, children, ...props }) { return ( <CSSTransition {...props}> {modal ? <Modal fixed={fixed}> {children} </Modal> : children } </CSSTransition> ); } Layer.displayName = 'MDCLayer'; Layer.propTypes = { modal: PropTypes.bool, fixed: PropTypes.bool };