import * as React from 'react'; import * as classNames from 'classnames'; import {Component, HTMLProps, MouseEvent, SFC} from 'react'; import {Nav, NavLink} from 'reactstrap'; import {Icon, Scrollbars} from './'; import {Drawer as MdcDrawer, DrawerHeader, DrawerHeaderContent, DrawerContent} from 'react-mdc-web/lib'; const styles = { scrollbars: { height: 'calc(100vh - 70px)', }, }; export interface Props extends HTMLProps<{}> { open?: boolean; title: string; onClose: () => void; } export class Drawer extends Component { private scrollbars: Scrollbars; static defaultProps: Partial = { open: false, }; render() { const {children, open, title} = this.props; return (

{title}

this.scrollbars = instance} style={styles.scrollbars} > {children}
); } handleClose = () => { this.scrollbars.scrollToTop(); this.props.onClose(); } }