mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-04 11:44:47 +08:00
fix(lint): final linter fixes
fix(lint): final set of linter fixes
This commit is contained in:
parent
2ff92946b7
commit
2d2e459094
25 changed files with 191 additions and 174 deletions
|
@ -34,12 +34,12 @@
|
|||
"quote-props": ["error", "consistent-as-needed", { "keywords": true }],
|
||||
"no-param-reassign": ["error", { "props": false }],
|
||||
"semi": "off",
|
||||
"import/no-unresolved": ["error", {"ignore": ["nylas-exports", "nylas-component-kit", "electron", "nylas-store", "react-dom/server", "nylas-observables", "windows-shortcuts"]}],
|
||||
"import/no-unresolved": ["error", {"ignore": ["nylas-exports", "nylas-component-kit", "electron", "nylas-store", "react-dom/server", "nylas-observables", "windows-shortcuts", "moment-round", "chrono-node", "event-kit"]}],
|
||||
"react/no-multi-comp": "off",
|
||||
"react/prop-types": ["error", {"ignore": ["children"]}],
|
||||
"react/sort-comp": "error"
|
||||
},
|
||||
"settings": {
|
||||
"import/resolver": {"node": {"extensions": [".es6", ".jsx", ".coffee", ".json", ".cjsx"]}}
|
||||
"import/resolver": {"node": {"extensions": [".es6", ".jsx", ".coffee", ".json", ".cjsx", ".js"]}}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ class TemplatePicker extends React.Component {
|
|||
_onChooseTemplate = (template) => {
|
||||
Actions.insertTemplateId({templateId: template.id, draftClientId: this.props.draftClientId});
|
||||
Actions.closePopover()
|
||||
};
|
||||
}
|
||||
|
||||
_onManageTemplates = () => {
|
||||
Actions.showTemplates();
|
||||
|
@ -95,7 +95,7 @@ class TemplatePicker extends React.Component {
|
|||
items={this.state.templates}
|
||||
itemKey={(item) => item.id}
|
||||
itemContent={(item) => item.name}
|
||||
onSelect={this._onChooseTemplate.bind(this)}
|
||||
onSelect={this._onChooseTemplate}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -7,10 +7,6 @@ class TemplateStatusBar extends React.Component {
|
|||
draft: React.PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps) {
|
||||
return (this._usingTemplate(nextProps) !== this._usingTemplate(this.props));
|
||||
}
|
||||
|
|
|
@ -115,9 +115,9 @@ class TranslateButton extends React.Component {
|
|||
return (
|
||||
<Menu
|
||||
className="translate-language-picker"
|
||||
items={ Object.keys(YandexLanguages) }
|
||||
itemKey={ (item) => item }
|
||||
itemContent={ (item) => item }
|
||||
items={Object.keys(YandexLanguages)}
|
||||
itemKey={(item) => item}
|
||||
itemContent={(item) => item}
|
||||
headerComponents={headerComponents}
|
||||
defaultSelectedIndex={-1}
|
||||
onSelect={this._onTranslate}
|
||||
|
@ -144,14 +144,17 @@ class TranslateButton extends React.Component {
|
|||
tabIndex={-1}
|
||||
className="btn btn-toolbar pull-right"
|
||||
onClick={this._onClickTranslateButton}
|
||||
title="Translate email body…">
|
||||
title="Translate email body…"
|
||||
>
|
||||
<RetinaImg
|
||||
mode={RetinaImg.Mode.ContentIsMask}
|
||||
url="nylas://composer-translate/assets/icon-composer-translate@2x.png" />
|
||||
url="nylas://composer-translate/assets/icon-composer-translate@2x.png"
|
||||
/>
|
||||
|
||||
<RetinaImg
|
||||
name="icon-composer-dropdown.png"
|
||||
mode={RetinaImg.Mode.ContentIsMask}/>
|
||||
mode={RetinaImg.Mode.ContentIsMask}
|
||||
/>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ export default class AccountContactField extends React.Component {
|
|||
_renderAccountSelector() {
|
||||
if (!this.props.value) {
|
||||
return (
|
||||
<span/>
|
||||
<span />
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,8 @@ export default class CollapsedParticipants extends React.Component {
|
|||
return (
|
||||
<span
|
||||
key={key}
|
||||
className="collapsed-contact regular-contact">
|
||||
className="collapsed-contact regular-contact"
|
||||
>
|
||||
<InjectedComponentSet
|
||||
matching={{role: "Composer:RecipientChip"}}
|
||||
exposedProps={{contact: contact}}
|
||||
|
@ -160,7 +161,8 @@ export default class CollapsedParticipants extends React.Component {
|
|||
<div
|
||||
tabIndex={0}
|
||||
ref="participantsWrap"
|
||||
className="collapsed-composer-participants">
|
||||
className="collapsed-composer-participants"
|
||||
>
|
||||
{this._renderNumRemaining()}
|
||||
{toDisplay}
|
||||
</div>
|
||||
|
|
|
@ -14,8 +14,9 @@ export default class ComposeButton extends React.Component {
|
|||
<button
|
||||
className="btn btn-toolbar item-compose"
|
||||
title="Compose new message"
|
||||
onClick={this._onNewCompose}>
|
||||
<RetinaImg name="toolbar-compose.png" mode={RetinaImg.Mode.ContentIsMask}/>
|
||||
onClick={this._onNewCompose}
|
||||
>
|
||||
<RetinaImg name="toolbar-compose.png" mode={RetinaImg.Mode.ContentIsMask} />
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -23,23 +23,29 @@ export default class ComposerHeaderActions extends React.Component {
|
|||
if (this.props.participantsFocused) {
|
||||
if (!this.props.enabledFields.includes(Fields.Cc)) {
|
||||
items.push(
|
||||
<span className="action show-cc" key="cc"
|
||||
onClick={ () => this.props.onShowAndFocusField(Fields.Cc) }>Cc</span>
|
||||
<span
|
||||
className="action show-cc" key="cc"
|
||||
onClick={() => this.props.onShowAndFocusField(Fields.Cc)}
|
||||
>Cc</span>
|
||||
);
|
||||
}
|
||||
|
||||
if (!this.props.enabledFields.includes(Fields.Bcc)) {
|
||||
items.push(
|
||||
<span className="action show-bcc" key="bcc"
|
||||
onClick={ () => this.props.onShowAndFocusField(Fields.Bcc) }>Bcc</span>
|
||||
<span
|
||||
className="action show-bcc" key="bcc"
|
||||
onClick={() => this.props.onShowAndFocusField(Fields.Bcc)}
|
||||
>Bcc</span>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.props.enabledFields.includes(Fields.Subject)) {
|
||||
items.push(
|
||||
<span className="action show-subject" key="subject"
|
||||
onClick={ () => this.props.onShowAndFocusField(Fields.Subject) }>Subject</span>
|
||||
<span
|
||||
className="action show-subject" key="subject"
|
||||
onClick={() => this.props.onShowAndFocusField(Fields.Subject)}
|
||||
>Subject</span>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -49,7 +55,8 @@ export default class ComposerHeaderActions extends React.Component {
|
|||
className="action show-popout"
|
||||
key="popout"
|
||||
title="Popout composer…"
|
||||
onClick={this._onPopoutComposer}>
|
||||
onClick={this._onPopoutComposer}
|
||||
>
|
||||
<RetinaImg
|
||||
name="composer-popout.png"
|
||||
mode={RetinaImg.Mode.ContentIsMask}
|
||||
|
|
|
@ -138,8 +138,9 @@ export default class ComposerHeader extends React.Component {
|
|||
}
|
||||
|
||||
_onFocusOutParticipants = (lastFocusedEl) => {
|
||||
const active = Fields.ParticipantFields.find((fieldName) =>
|
||||
this.refs[fieldName] ? ReactDOM.findDOMNode(this.refs[fieldName]).contains(lastFocusedEl) : false
|
||||
const active = Fields.ParticipantFields.find((fieldName) => {
|
||||
return this.refs[fieldName] ? ReactDOM.findDOMNode(this.refs[fieldName]).contains(lastFocusedEl) : false
|
||||
}
|
||||
);
|
||||
this.setState({
|
||||
participantsFocused: false,
|
||||
|
@ -180,7 +181,8 @@ export default class ComposerHeader extends React.Component {
|
|||
ref="participantsContainer"
|
||||
className="expanded-participants"
|
||||
onFocusIn={this._onFocusInParticipants}
|
||||
onFocusOut={this._onFocusOutParticipants}>
|
||||
onFocusOut={this._onFocusOutParticipants}
|
||||
>
|
||||
{content}
|
||||
</KeyCommandsRegion>
|
||||
);
|
||||
|
@ -193,14 +195,16 @@ export default class ComposerHeader extends React.Component {
|
|||
return (
|
||||
<div
|
||||
key="subject-wrap"
|
||||
className="compose-subject-wrap">
|
||||
className="compose-subject-wrap"
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
name="subject"
|
||||
ref={Fields.Subject}
|
||||
placeholder="Subject"
|
||||
value={this.props.draft.subject}
|
||||
onChange={this._onChangeSubject}/>
|
||||
onChange={this._onChangeSubject}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -232,7 +236,7 @@ export default class ComposerHeader extends React.Component {
|
|||
key="cc"
|
||||
field="cc"
|
||||
change={this._onChangeParticipants}
|
||||
onEmptied={ () => this.hideField(Fields.Cc) }
|
||||
onEmptied={() => this.hideField(Fields.Cc)}
|
||||
className="composer-participant-field cc-field"
|
||||
participants={{to, cc, bcc}}
|
||||
draft={this.props.draft}
|
||||
|
@ -248,7 +252,7 @@ export default class ComposerHeader extends React.Component {
|
|||
key="bcc"
|
||||
field="bcc"
|
||||
change={this._onChangeParticipants}
|
||||
onEmptied={ () => this.hideField(Fields.Bcc) }
|
||||
onEmptied={() => this.hideField(Fields.Bcc)}
|
||||
className="composer-participant-field bcc-field"
|
||||
participants={{to, cc, bcc}}
|
||||
draft={this.props.draft}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import _ from 'underscore';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import {remote} from 'electron'
|
||||
|
||||
import {
|
||||
Utils,
|
||||
|
@ -152,7 +153,8 @@ export default class ComposerView extends React.Component {
|
|||
className="compose-body"
|
||||
ref="composeBody"
|
||||
onMouseUp={this._onMouseUpComposerBody}
|
||||
onMouseDown={this._onMouseDownComposerBody}>
|
||||
onMouseDown={this._onMouseDownComposerBody}
|
||||
>
|
||||
{this._renderBodyRegions()}
|
||||
{this._renderFooterRegions()}
|
||||
</div>
|
||||
|
@ -248,7 +250,8 @@ export default class ComposerView extends React.Component {
|
|||
draftClientId: this.props.draft.clientId,
|
||||
session: this.props.session,
|
||||
}}
|
||||
direction="column"/>
|
||||
direction="column"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -337,7 +340,8 @@ export default class ComposerView extends React.Component {
|
|||
className="btn btn-toolbar btn-trash"
|
||||
style={{order: 100}}
|
||||
title="Delete draft"
|
||||
onClick={this._onDestroyDraft}>
|
||||
onClick={this._onDestroyDraft}
|
||||
>
|
||||
<RetinaImg name="icon-composer-trash.png" mode={RetinaImg.Mode.ContentIsMask} />
|
||||
</button>
|
||||
|
||||
|
@ -346,7 +350,8 @@ export default class ComposerView extends React.Component {
|
|||
className="btn btn-toolbar btn-attach"
|
||||
style={{order: 50}}
|
||||
title="Attach file"
|
||||
onClick={this._onSelectAttachment}>
|
||||
onClick={this._onSelectAttachment}
|
||||
>
|
||||
<RetinaImg name="icon-composer-attachment.png" mode={RetinaImg.Mode.ContentIsMask} />
|
||||
</button>
|
||||
|
||||
|
@ -480,7 +485,6 @@ export default class ComposerView extends React.Component {
|
|||
return false;
|
||||
}
|
||||
|
||||
const {remote} = require('electron');
|
||||
const dialog = remote.require('dialog');
|
||||
|
||||
const {to, cc, bcc, body, files, uploads} = this.props.draft;
|
||||
|
@ -635,18 +639,21 @@ export default class ComposerView extends React.Component {
|
|||
localHandlers={this._keymapHandlers()}
|
||||
className={"message-item-white-wrap composer-outer-wrap"}
|
||||
tabIndex="-1"
|
||||
ref="composerWrap">
|
||||
ref="composerWrap"
|
||||
>
|
||||
<TabGroupRegion className="composer-inner-wrap">
|
||||
<DropZone
|
||||
className="composer-inner-wrap"
|
||||
shouldAcceptDrop={this._shouldAcceptDrop}
|
||||
onDragStateChange={ ({isDropping}) => this.setState({isDropping}) }
|
||||
onDrop={this._onDrop}>
|
||||
onDragStateChange={({isDropping}) => this.setState({isDropping})}
|
||||
onDrop={this._onDrop}
|
||||
>
|
||||
<div className="composer-drop-cover" style={{display: dropCoverDisplay}}>
|
||||
<div className="centered">
|
||||
<RetinaImg
|
||||
name="composer-drop-to-attach.png"
|
||||
mode={RetinaImg.Mode.ContentIsMask}/>
|
||||
mode={RetinaImg.Mode.ContentIsMask}
|
||||
/>
|
||||
Drop to attach
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -17,7 +17,7 @@ export default class ImageFileUpload extends FileUpload {
|
|||
return (
|
||||
<div className="file-wrap file-image-wrap file-upload">
|
||||
<div className="file-action-icon" onClick={this._onClickRemove}>
|
||||
<RetinaImg name="image-cancel-button.png" mode={RetinaImg.Mode.ContentPreserve}/>
|
||||
<RetinaImg name="image-cancel-button.png" mode={RetinaImg.Mode.ContentPreserve} />
|
||||
</div>
|
||||
|
||||
<div className="file-preview">
|
||||
|
@ -25,7 +25,7 @@ export default class ImageFileUpload extends FileUpload {
|
|||
<div className="file-name">{this.props.upload.filename}</div>
|
||||
</div>
|
||||
|
||||
<img src={this.props.upload.targetPath} onDragStart={this._onDragStart}/>
|
||||
<img src={this.props.upload.targetPath} alt="drag start" onDragStart={this._onDragStart} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -8,6 +8,8 @@ const CONFIG_KEY = "core.sending.defaultSendType";
|
|||
export default class SendActionButton extends React.Component {
|
||||
static displayName = "SendActionButton";
|
||||
|
||||
static containerRequired = false
|
||||
|
||||
static propTypes = {
|
||||
draft: React.PropTypes.object,
|
||||
isValidDraft: React.PropTypes.func,
|
||||
|
@ -32,8 +34,6 @@ export default class SendActionButton extends React.Component {
|
|||
this.unsub();
|
||||
}
|
||||
|
||||
static containerRequired = false
|
||||
|
||||
primaryClick() {
|
||||
this._onPrimaryClick();
|
||||
}
|
||||
|
@ -139,7 +139,8 @@ export default class SendActionButton extends React.Component {
|
|||
tabIndex={-1}
|
||||
className={"btn btn-toolbar btn-normal btn-emphasis btn-text btn-send"}
|
||||
style={{order: -100}}
|
||||
onClick={this._onPrimaryClick}>
|
||||
onClick={this._onPrimaryClick}
|
||||
>
|
||||
{this._contentForAction(this.state.actionConfigs[0])}
|
||||
</button>
|
||||
);
|
||||
|
@ -151,7 +152,7 @@ export default class SendActionButton extends React.Component {
|
|||
const menu = (
|
||||
<Menu
|
||||
items={rest}
|
||||
itemKey={ (actionConfig) => actionConfig.configKey }
|
||||
itemKey={(actionConfig) => actionConfig.configKey}
|
||||
itemContent={this._contentForAction}
|
||||
onSelect={this._onSendWithAction}
|
||||
/>
|
||||
|
|
|
@ -33,7 +33,8 @@ class DraftListToolbar extends Component {
|
|||
const toolbarElement = (
|
||||
<InjectedComponentSet
|
||||
matching={{role: "DraftActionsToolbarButton"}}
|
||||
exposedProps={{selection, items}} />
|
||||
exposedProps={{selection, items}}
|
||||
/>
|
||||
)
|
||||
|
||||
return (
|
||||
|
|
|
@ -3,61 +3,55 @@ import GithubUserStore from "./github-user-store";
|
|||
import {React} from 'nylas-exports';
|
||||
|
||||
// Small React component that renders a single Github repository
|
||||
class GithubRepo extends React.Component {
|
||||
static displayName = 'GithubRepo';
|
||||
const GithubRepo = function GithubRepo(props) {
|
||||
const {repo} = props;
|
||||
|
||||
static propTypes = {
|
||||
// This component takes a `repo` object as a prop. Listing props is optional
|
||||
// but enables nice React warnings when our expectations aren't met
|
||||
repo: React.PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
render() {
|
||||
const {repo} = this.props;
|
||||
|
||||
return (
|
||||
<div className="repo">
|
||||
<div className="stars">{repo.stargazers_count}</div>
|
||||
<a href={repo.html_url}>{repo.full_name}</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="repo">
|
||||
<div className="stars">{repo.stargazers_count}</div>
|
||||
<a href={repo.html_url}>{repo.full_name}</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
GithubRepo.propTypes = {
|
||||
// This component takes a `repo` object as a prop. Listing props is optional
|
||||
// but enables nice React warnings when our expectations aren't met
|
||||
repo: React.PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
// Small React component that renders the user's Github profile.
|
||||
class GithubProfile extends React.Component {
|
||||
static displayName = 'GithubProfile';
|
||||
const GithubProfile = function GithubProfile(props) {
|
||||
const {profile} = props;
|
||||
|
||||
static propTypes = {
|
||||
// This component takes a `profile` object as a prop. Listing props is optional
|
||||
// but enables nice React warnings when our expectations aren't met.
|
||||
profile: React.PropTypes.object.isRequired,
|
||||
}
|
||||
// Transform the profile's array of repos into an array of React <GithubRepo> elements
|
||||
const repoElements = _.map(profile.repos, (repo) => {
|
||||
return <GithubRepo key={repo.id} repo={repo} />
|
||||
});
|
||||
|
||||
render() {
|
||||
const {profile} = this.props;
|
||||
|
||||
// Transform the profile's array of repos into an array of React <GithubRepo> elements
|
||||
const repoElements = _.map(profile.repos, (repo) => {
|
||||
return <GithubRepo key={repo.id} repo={repo} />
|
||||
});
|
||||
|
||||
// Remember - this looks like HTML, but it's actually CJSX, which is converted into
|
||||
// Coffeescript at transpile-time. We're actually creating a nested tree of Javascript
|
||||
// objects here that *represent* the DOM we want.
|
||||
return (
|
||||
<div className="profile">
|
||||
<img className="logo" src="nylas://github-contact-card/assets/github.png"/>
|
||||
<a href={profile.html_url}>{profile.login}</a>
|
||||
<div>{repoElements}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
// Remember - this looks like HTML, but it's actually CJSX, which is converted into
|
||||
// Coffeescript at transpile-time. We're actually creating a nested tree of Javascript
|
||||
// objects here that *represent* the DOM we want.
|
||||
return (
|
||||
<div className="profile">
|
||||
<img className="logo" alt="github logo" src="nylas://github-contact-card/assets/github.png" />
|
||||
<a href={profile.html_url}>{profile.login}</a>
|
||||
<div>{repoElements}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
GithubProfile.propTypes = {
|
||||
// This component takes a `profile` object as a prop. Listing props is optional
|
||||
// but enables nice React warnings when our expectations aren't met.
|
||||
profile: React.PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
export default class GithubContactCardSection extends React.Component {
|
||||
static displayName = 'GithubContactCardSection';
|
||||
|
||||
static containerStyles = {
|
||||
order: 10,
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = this._getStateFromStores();
|
||||
|
@ -102,10 +96,6 @@ export default class GithubContactCardSection extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
static containerStyles = {
|
||||
order: 10,
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="sidebar-github-profile">
|
||||
|
|
|
@ -42,11 +42,11 @@ export default class AutoloadImagesHeader extends React.Component {
|
|||
|
||||
return (
|
||||
<div className="autoload-images-header">
|
||||
<a className="option" onClick={ () => Actions.temporarilyEnableImages(message) }>
|
||||
<a className="option" onClick={() => Actions.temporarilyEnableImages(message)}>
|
||||
Show Images
|
||||
</a>
|
||||
<span style={{paddingLeft: 10, paddingRight: 10}}>|</span>
|
||||
<a className="option" onClick={ () => Actions.permanentlyEnableImages(message) }>
|
||||
<a className="option" onClick={() => Actions.permanentlyEnableImages(message)}>
|
||||
Always show images from {message.fromContact().toString()}
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -142,7 +142,8 @@ export default class EmailFrame extends React.Component {
|
|||
<div
|
||||
className="iframe-container"
|
||||
ref="iframeHeightHolder"
|
||||
style={{height: this._lastComputedHeight}}>
|
||||
style={{height: this._lastComputedHeight}}
|
||||
>
|
||||
<EventedIFrame
|
||||
ref="iframe"
|
||||
seamless="seamless"
|
||||
|
|
|
@ -53,6 +53,7 @@ export default class FindInThread extends React.Component {
|
|||
this._clearSearch()
|
||||
ReactDOM.findDOMNode(this.refs.searchBox).blur()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
_selectionText() {
|
||||
|
@ -94,44 +95,55 @@ export default class FindInThread extends React.Component {
|
|||
return (
|
||||
<div className={rootCls} onClick={this._focusSearch}>
|
||||
<KeyCommandsRegion globalHandlers={this._globalKeymapHandlers()}>
|
||||
<div className="controls-wrap" ref="controlsWrap">
|
||||
<div className="input-wrap">
|
||||
<div className="controls-wrap" ref="controlsWrap">
|
||||
<div className="input-wrap">
|
||||
|
||||
<input type="text"
|
||||
ref="searchBox"
|
||||
placeholder="Find in thread"
|
||||
onChange={this._onFindChange}
|
||||
onKeyDown={this._onFindKeyDown}
|
||||
value={this.state.searchTerm || ""}/>
|
||||
<input
|
||||
type="text"
|
||||
ref="searchBox"
|
||||
placeholder="Find in thread"
|
||||
onChange={this._onFindChange}
|
||||
onKeyDown={this._onFindKeyDown}
|
||||
value={this.state.searchTerm || ""}
|
||||
/>
|
||||
|
||||
<div className="selection-progress">{this._selectionText()}</div>
|
||||
<div className="selection-progress">{this._selectionText()}</div>
|
||||
|
||||
<div className="btn-wrap">
|
||||
<button tabIndex={-1}
|
||||
className={btnCls}
|
||||
disabled={!this._navEnabled()}
|
||||
onClick={this._onPrevResult}>
|
||||
<RetinaImg name="ic-findinthread-previous.png"
|
||||
mode={RetinaImg.Mode.ContentIsMask}/>
|
||||
</button>
|
||||
<div className="btn-wrap">
|
||||
<button
|
||||
tabIndex={-1}
|
||||
className={btnCls}
|
||||
disabled={!this._navEnabled()}
|
||||
onClick={this._onPrevResult}
|
||||
>
|
||||
<RetinaImg
|
||||
name="ic-findinthread-previous.png"
|
||||
mode={RetinaImg.Mode.ContentIsMask}
|
||||
/>
|
||||
</button>
|
||||
|
||||
<button
|
||||
className={btnCls}
|
||||
tabIndex={-1}
|
||||
disabled={!this._navEnabled()}
|
||||
onClick={this._onNextResult}
|
||||
>
|
||||
<RetinaImg
|
||||
name="ic-findinthread-next.png"
|
||||
mode={RetinaImg.Mode.ContentIsMask}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button className={btnCls}
|
||||
tabIndex={-1}
|
||||
disabled={!this._navEnabled()}
|
||||
onClick={this._onNextResult}>
|
||||
<RetinaImg name="ic-findinthread-next.png"
|
||||
mode={RetinaImg.Mode.ContentIsMask}/>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button className={btnCls} onClick={this._clearSearch} >
|
||||
<RetinaImg
|
||||
name="ic-findinthread-close.png"
|
||||
mode={RetinaImg.Mode.ContentIsMask}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button className={btnCls}
|
||||
onClick={this._clearSearch}>
|
||||
<RetinaImg name="ic-findinthread-close.png"
|
||||
mode={RetinaImg.Mode.ContentIsMask}/>
|
||||
</button>
|
||||
</div>
|
||||
</KeyCommandsRegion>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -14,6 +14,8 @@ class PreferencesRoot extends React.Component {
|
|||
|
||||
static displayName = 'PreferencesRoot';
|
||||
|
||||
static containerRequired = false;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.state = this.getStateFromStores();
|
||||
|
@ -51,8 +53,6 @@ class PreferencesRoot extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
static containerRequired = false;
|
||||
|
||||
_localHandlers() {
|
||||
const stopPropagation = (e) => {
|
||||
e.stopPropagation();
|
||||
|
@ -100,8 +100,10 @@ class PreferencesRoot extends React.Component {
|
|||
return (
|
||||
<KeyCommandsRegion className="preferences-wrap" tabIndex="1" localHandlers={this._localHandlers()}>
|
||||
<Flexbox direction="column">
|
||||
<PreferencesTabsBar tabs={this.state.tabs}
|
||||
selection={this.state.selection} />
|
||||
<PreferencesTabsBar
|
||||
tabs={this.state.tabs}
|
||||
selection={this.state.selection}
|
||||
/>
|
||||
<ScrollRegion className="preferences-content">
|
||||
<ConfigPropContainer ref="content">
|
||||
{bodyElement}
|
||||
|
|
|
@ -4,7 +4,7 @@ import _ from 'underscore';
|
|||
import { Flexbox } from 'nylas-component-kit';
|
||||
import fs from 'fs';
|
||||
|
||||
import {keyAndModifiersForEvent} from './mousestrap-keybinding-helpers';
|
||||
import {keyAndModifiersForEvent} from './mousetrap-keybinding-helpers';
|
||||
|
||||
export default class CommandKeybinding extends React.Component {
|
||||
static propTypes = {
|
||||
|
@ -67,7 +67,7 @@ export default class CommandKeybinding extends React.Component {
|
|||
splitKeystrokes.forEach((keystroke, kidx) => {
|
||||
elements.push(<span key={kidx}>{this._formatKeystrokes(keystroke)}</span>);
|
||||
if (kidx < splitKeystrokes.length - 1) {
|
||||
elements.push(<span className="then" key={'then' + kidx}> then </span>);
|
||||
elements.push(<span className="then" key={`then${kidx}`}> then </span>);
|
||||
}
|
||||
});
|
||||
return (
|
||||
|
@ -143,7 +143,8 @@ export default class CommandKeybinding extends React.Component {
|
|||
onKeyDown={this._onKey}
|
||||
onKeyPress={this._onKey}
|
||||
onFocus={this._onEdit}
|
||||
onBlur={this._onFinishedEditing}>
|
||||
onBlur={this._onFinishedEditing}
|
||||
>
|
||||
<div className="col-left shortcut-name">
|
||||
{this.props.label}
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import React from 'react';
|
||||
import {RetinaImg, Flexbox} from 'nylas-component-kit';
|
||||
|
||||
|
||||
class AppearanceModeSwitch extends React.Component {
|
||||
|
||||
static displayName = 'AppearanceModeSwitch';
|
||||
|
@ -33,7 +32,8 @@ class AppearanceModeSwitch extends React.Component {
|
|||
mode={mode}
|
||||
key={mode}
|
||||
active={this.state.value === mode}
|
||||
onClick={() => this.setState({value: mode})} />
|
||||
onClick={() => this.setState({value: mode})}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,8 @@ class AppearanceModeSwitch extends React.Component {
|
|||
<Flexbox
|
||||
direction="row"
|
||||
style={{alignItems: "center"}}
|
||||
className="item">
|
||||
className="item"
|
||||
>
|
||||
{this._renderModeOptions()}
|
||||
</Flexbox>
|
||||
<div className={applyChangesClass} onClick={this._onApplyChanges}>Apply Layout</div>
|
||||
|
@ -57,36 +58,27 @@ class AppearanceModeSwitch extends React.Component {
|
|||
|
||||
}
|
||||
|
||||
const AppearanceModeOption = function AppearanceModeOption(props) {
|
||||
let classname = "appearance-mode";
|
||||
if (props.active) classname += " active";
|
||||
|
||||
class AppearanceModeOption extends React.Component {
|
||||
static propTypes = {
|
||||
mode: React.PropTypes.string.isRequired,
|
||||
active: React.PropTypes.bool,
|
||||
onClick: React.PropTypes.func,
|
||||
}
|
||||
const label = {
|
||||
list: 'Single Panel',
|
||||
split: 'Two Panel',
|
||||
}[props.mode];
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
render() {
|
||||
let classname = "appearance-mode";
|
||||
if (this.props.active) classname += " active";
|
||||
|
||||
const label = {
|
||||
'list': 'Single Panel',
|
||||
'split': 'Two Panel',
|
||||
}[this.props.mode];
|
||||
|
||||
return (
|
||||
<div className={classname} onClick={this.props.onClick}>
|
||||
<RetinaImg name={`appearance-mode-${this.props.mode}.png`} mode={RetinaImg.Mode.ContentIsMask}/>
|
||||
<div>{label}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className={classname} onClick={props.onClick}>
|
||||
<RetinaImg name={`appearance-mode-${props.mode}.png`} mode={RetinaImg.Mode.ContentIsMask} />
|
||||
<div>{label}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
AppearanceModeOption.propTypes = {
|
||||
mode: React.PropTypes.string.isRequired,
|
||||
active: React.PropTypes.bool,
|
||||
onClick: React.PropTypes.func,
|
||||
}
|
||||
|
||||
|
||||
class PreferencesAppearance extends React.Component {
|
||||
|
||||
|
@ -101,7 +93,6 @@ class PreferencesAppearance extends React.Component {
|
|||
NylasEnv.commands.dispatch("window:launch-theme-picker");
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="container-appearance">
|
||||
|
@ -111,7 +102,6 @@ class PreferencesAppearance extends React.Component {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default PreferencesAppearance;
|
||||
|
|
|
@ -4,7 +4,7 @@ const SnoozeActions = Reflux.createActions([
|
|||
'snoozeThreads',
|
||||
])
|
||||
|
||||
for (const key in SnoozeActions) {
|
||||
for (const key of Object.keys(SnoozeActions)) {
|
||||
SnoozeActions[key].sync = true
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class DeltaStreamingConnection {
|
|||
if (cursor) {
|
||||
return callback(cursor)
|
||||
}
|
||||
this.api.makeRequest({
|
||||
return this.api.makeRequest({
|
||||
path: "/delta/latest_cursor",
|
||||
accountId: this.accountId,
|
||||
method: 'POST',
|
||||
|
|
|
@ -3,7 +3,6 @@ import _ from 'underscore'
|
|||
import url from 'url'
|
||||
import {Emitter} from 'event-kit'
|
||||
|
||||
|
||||
const CONNECTION_TIMEOUT = 60 * 60 * 1000
|
||||
const RESULTS_THROTTLE = 400
|
||||
|
||||
|
|
2
src/pro
2
src/pro
|
@ -1 +1 @@
|
|||
Subproject commit d2ba2ad629341375009b6270c3906c5933e1a255
|
||||
Subproject commit dbdce0e2dcc09a1c7460e8945feaeda1b66492ef
|
Loading…
Add table
Reference in a new issue