import React from 'react' import {Utils} from 'nylas-exports' import {NylasCalendar} from 'nylas-component-kit' import SchedulerActions from '../scheduler-actions' import ProposedTimeCalendarStore from '../proposed-time-calendar-store' import ProposedTimeCalendarDataSource from './proposed-time-calendar-data-source' /** * A an extended NylasCalendar that lets you pick proposed times. */ export default class ProposedTimePicker extends React.Component { static displayName = "ProposedTimePicker"; constructor(props) { super(props); this.state = { duration: ProposedTimeCalendarStore.currentDuration(), pendingSave: ProposedTimeCalendarStore.pendingSave(), } } componentDidMount() { this._usub = ProposedTimeCalendarStore.listen(() => { this.setState({ duration: ProposedTimeCalendarStore.currentDuration(), pendingSave: ProposedTimeCalendarStore.pendingSave(), }); }) } shouldComponentUpdate(nextProps, nextState) { return (!Utils.isEqualReact(nextProps, this.props) || !Utils.isEqualReact(nextState, this.state)); } componentWillUnmount() { this._usub() } static containerStyles = { height: "100%", } _dataSource() { return new ProposedTimeCalendarDataSource() } _bannerComponents = () => { return { week: "Click and drag to propose times." } } _footerComponents = () => { return { week: [this._leftFooterComponents(), this._rightFooterComponents()], } } _leftFooterComponents() { const optComponents = ProposedTimeCalendarStore.DURATIONS.map((opt, i) => { return }) return (