import React from 'react'; import {Contenteditable} from 'nylas-component-kit'; import {AccountStore} from 'nylas-exports'; import SignatureStore from './signature-store'; import SignatureActions from './signature-actions'; export default class PreferencesSignatures extends React.Component { static displayName = 'PreferencesSignatures'; constructor(props) { super(props); this.state = this._getStateFromStores(); } componentDidMount() { this.usub = AccountStore.listen(this._onChange); } componentWillUnmount() { this.usub(); } _onChange = () => { this.setState(this._getStateFromStores()); } _getStateFromStores() { const accounts = AccountStore.accounts(); const state = this.state || {}; let {currentAccountId} = state; if (!accounts.find(acct => acct.id === currentAccountId)) { currentAccountId = accounts[0].id; } return { accounts, currentAccountId, currentSignature: SignatureStore.signatureForAccountId(currentAccountId), editAsHTML: state.editAsHTML, }; } _renderAccountPicker() { const options = this.state.accounts.map(account => ); return ( ); } _renderEditableSignature() { return ( ); } _renderHTMLSignature() { return (