import React, {PureComponent} from 'react'; import autobind from 'autobind-decorator'; import Modal from '../base/modal'; import ModalBody from '../base/modal-body'; import ModalHeader from '../base/modal-header'; import HelpTooltip from '../help-tooltip'; import * as models from '../../../models'; import {trackEvent} from '../../../analytics/index'; import DebouncedInput from '../base/debounced-input'; @autobind class RequestSettingsModal extends PureComponent { constructor (props) { super(props); this.state = { request: null }; } _setModalRef (n) { this.modal = n; } async _updateRequestSettingBoolean (e) { const value = e.target.checked; const setting = e.target.name; const request = await models.request.update(this.state.request, {[setting]: value}); this.setState({request}); trackEvent('Request Settings', setting, value ? 'Enable' : 'Disable'); } async _handleNameChange (name) { const request = await models.request.update(this.state.request, {name}); this.setState({request}); } show (request) { this.modal.show(); this.setState({request}); } hide () { this.modal.hide(); } renderCheckboxInput (setting) { return ( ); } renderModalBody (request) { return (

Cookie Handling

Advanced Settings

); } render () { const {request} = this.state; return ( Request Settings {request ? this.renderModalBody(request) : null} ); } } RequestSettingsModal.propTypes = {}; export default RequestSettingsModal;