mirror of
https://github.com/wassname/talk.git
synced 2026-07-06 05:17:19 +08:00
20 lines
482 B
JavaScript
20 lines
482 B
JavaScript
import React, {PropTypes} from 'react';
|
||
import styles from './Drawer.css';
|
||
import onClickOutside from 'react-onclickoutside';
|
||
|
||
const Drawer = ({children, handleClickOutside}) => {
|
||
return (
|
||
<div className={styles.drawer}>
|
||
<div className={styles.closeButton} onClick={handleClickOutside}>×</div>
|
||
{children}
|
||
</div>
|
||
);
|
||
};
|
||
|
||
Drawer.propTypes = {
|
||
active: PropTypes.bool,
|
||
handleClickOutside: PropTypes.func.isRequired
|
||
};
|
||
|
||
export default onClickOutside(Drawer);
|