Mailspring/internal_packages/thread-snooze/lib/snooze-popover.jsx
Ben Gotow 0553b7bde3 fix(snooze): A few minor popover adjustments. See desc.
- Rather than have a `showing` prop on the fixed popover, I just remove it and put a span in it's place when it's gone. This means we always get componentDidMount when the popover appears and simplifies when to focus it's content.
- The fixed popover implements esc and blur behaviors itself
- The fixed popover uses the background-secondary color and works in dark mode
- The snooze items have hover and active states
2016-02-24 20:05:21 -08:00

45 lines
1.1 KiB
JavaScript

/** @babel */
import React, {Component, PropTypes} from 'react';
import {Actions} from 'nylas-exports';
import {Popover} from 'nylas-component-kit';
import SnoozePopoverBody from './snooze-popover-body';
class SnoozePopover extends Component {
static displayName = 'SnoozePopover';
static propTypes = {
threads: PropTypes.array.isRequired,
buttonComponent: PropTypes.object.isRequired,
direction: PropTypes.string,
pointerStyle: PropTypes.object,
popoverStyle: PropTypes.object,
};
closePopover = ()=> {
this.refs.popover.close();
};
render() {
const {buttonComponent, direction, popoverStyle, pointerStyle, threads} = this.props
return (
<Popover
ref="popover"
className="snooze-popover"
direction={direction || 'down-align-left'}
buttonComponent={buttonComponent}
popoverStyle={popoverStyle}
pointerStyle={pointerStyle}
onOpened={()=> Actions.closePopover()}>
<SnoozePopoverBody
threads={threads}
closePopover={this.closePopover}/>
</Popover>
);
}
}
export default SnoozePopover;