import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Card, CardHeader, CardBlock, FormGroup, Label, Input } from 'reactstrap'; import { initialize } from '..'; class ConnectionOverlay extends Component { constructor() { super(); this.state = { uri: "ws://127.0.0.1:8412", autoconnect: false, connecting: false }; // TODO: "connecting..." UI // TODO: autoconnect // TODO: gracefully handle dis/reconnections } render() { const { socket } = this.props; if (socket.connected) { return null; } const { uri, autoconnect } = this.state; return (
Connect to synapse this.setState({ uri: e.target.value })} />
); } } export default connect(state => ({ socket: state.socket }))(ConnectionOverlay);