import React from 'react'; import { Store, ContactsPerspective } from './Store'; import { localized, Actions, AccountStore } from 'mailspring-exports'; import * as Icons from './SVGIcons'; import { ListensToFluxStore, BindGlobalCommands } from 'mailspring-component-kit'; interface AddContactToolbarProps { editing: string | 'new' | false; perspective: ContactsPerspective; focusedId?: string; } class AddContactToolbarWithData extends React.Component { constructor(props: AddContactToolbarProps) { super(props); } onAdd = () => { Actions.setFocus({ collection: 'contact', item: null }); Store.setEditing('new'); }; render() { const { editing, perspective } = this.props; const enabled = editing === false && perspective && perspective.accountId; const acct = perspective && AccountStore.accountForId(perspective.accountId); return (
); } } export const AddContactToolbar: React.FunctionComponent< AddContactToolbarProps > = ListensToFluxStore( ({ listSource, editing, perspective }) => ( ), { stores: [Store], getStateFromStores: () => ({ editing: Store.editing(), perspective: Store.perspective(), }), } ); AddContactToolbar.displayName = 'AddContactToolbar';