Files
talk/client/coral-ui/components/Drawer.js
T
2018-01-05 14:24:21 -03:00

25 lines
628 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React from 'react';
import cn from 'classnames';
import PropTypes from 'prop-types';
import styles from './Drawer.css';
const Drawer = ({children, onClose, className = ''}) => {
return (
<div className={cn(styles.drawer, className)}>
<button className={cn(styles.closeButton, [className, 'close-button'].join('-'))} onClick={onClose}>×</button>
<div className={styles.content}>
{children}
</div>
</div>
);
};
Drawer.propTypes = {
active: PropTypes.bool,
onClose: PropTypes.func.isRequired,
children: PropTypes.node,
className: PropTypes.string,
};
export default Drawer;