2016-02-19 02:00:11 +08:00
|
|
|
/** @babel */
|
|
|
|
import React, {Component, PropTypes} from 'react';
|
2016-02-25 07:08:53 +08:00
|
|
|
import {Actions} from 'nylas-exports';
|
2016-02-19 02:00:11 +08:00
|
|
|
import {Popover} from 'nylas-component-kit';
|
2016-02-23 07:48:07 +08:00
|
|
|
import SnoozePopoverBody from './snooze-popover-body';
|
2016-02-19 02:00:11 +08:00
|
|
|
|
|
|
|
|
|
|
|
class SnoozePopover extends Component {
|
|
|
|
static displayName = 'SnoozePopover';
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
threads: PropTypes.array.isRequired,
|
|
|
|
buttonComponent: PropTypes.object.isRequired,
|
2016-02-23 07:48:07 +08:00
|
|
|
direction: PropTypes.string,
|
|
|
|
pointerStyle: PropTypes.object,
|
|
|
|
popoverStyle: PropTypes.object,
|
2016-02-19 02:00:11 +08:00
|
|
|
};
|
|
|
|
|
2016-02-25 02:26:47 +08:00
|
|
|
closePopover = ()=> {
|
|
|
|
this.refs.popover.close();
|
|
|
|
};
|
|
|
|
|
2016-02-19 02:00:11 +08:00
|
|
|
render() {
|
2016-02-23 07:48:07 +08:00
|
|
|
const {buttonComponent, direction, popoverStyle, pointerStyle, threads} = this.props
|
2016-02-19 02:00:11 +08:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Popover
|
2016-02-25 02:26:47 +08:00
|
|
|
ref="popover"
|
2016-02-19 02:00:11 +08:00
|
|
|
className="snooze-popover"
|
2016-02-23 07:48:07 +08:00
|
|
|
direction={direction || 'down-align-left'}
|
|
|
|
buttonComponent={buttonComponent}
|
|
|
|
popoverStyle={popoverStyle}
|
2016-02-25 07:08:53 +08:00
|
|
|
pointerStyle={pointerStyle}
|
|
|
|
onOpened={()=> Actions.closePopover()}>
|
2016-02-25 12:05:16 +08:00
|
|
|
<SnoozePopoverBody
|
|
|
|
threads={threads}
|
|
|
|
closePopover={this.closePopover}/>
|
2016-02-19 02:00:11 +08:00
|
|
|
</Popover>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SnoozePopover;
|