fix(snooze): Fix quick action button, remove italic from popover

This commit is contained in:
Juan Tejada 2016-02-24 15:33:13 -08:00
parent 793941ef92
commit 3187d2f0d1
2 changed files with 7 additions and 4 deletions

View file

@ -1,5 +1,5 @@
import React, {Component, PropTypes} from 'react';
import {PopoverStore, Actions} from 'nylas-exports';
import {Actions} from 'nylas-exports';
import SnoozePopoverBody from './snooze-popover-body';
@ -12,12 +12,14 @@ class QuickActionSnoozeButton extends Component {
constructor() {
super();
this.openedPopover = false;
}
onClick = (event)=> {
event.stopPropagation()
if (PopoverStore.isPopoverOpen()) {
if (this.openedPopover) {
Actions.closePopover();
this.openedPopover = false;
return;
}
const {thread} = this.props;
@ -30,10 +32,11 @@ class QuickActionSnoozeButton extends Component {
// The parent node is a bit too much to the left, lets adjust this.
const rect = {height, width, top, bottom, right, left: left + 5}
Actions.openPopover(
<SnoozePopoverBody threads={[thread]}/>,
<SnoozePopoverBody threads={[thread]} closePopover={Actions.closePopover}/>,
rect,
"left"
)
this.openedPopover = true;
};
static containerRequired = false;

View file

@ -143,7 +143,7 @@ class SnoozePopoverBody extends Component {
onMouseDown={this.onInputMouseDown}
onKeyDown={this.onInputKeyDown}
onChange={this.onInputChange}/>
<em className="input-date-value">{formatted}</em>
<span className="input-date-value">{formatted}</span>
</div>
);
};