// // Button to show details for configuring mail clients // import React from 'react' import { Modal, Form, FormGroup, ControlLabel, FormControl, Col, Label, Button} from 'react-bootstrap' import Account from 'models/account' import bitmask from 'lib/bitmask' export default class IMAPButton extends React.Component { static get defaultProps() {return{ account: null, title: "Configure A Mail Client" }} constructor(props) { super(props) this.state = { showModal: false, imapPort: '1984', smtpPort: '2013', token: '' } this.onClick = this.onClick.bind(this) this.onClose = this.onClose.bind(this) } onClose() { this.setState({showModal: false}) } onClick() { if (!this.state.token) { bitmask.mail.get_token(this.props.account.id).then(response => { this.setState({token: response.token}) }) } this.setState({showModal: true}) } componentWillMount() {} // don't allow fields to be changed onChange() {} render () { let rowStyle = {height: '30px'} // to match bootstrap's input element height let form = null let modal = null if (this.state.showModal) { form = (
) modal = (