import React, { PureComponent } from 'react'; import { connect } from 'react-redux'; import { createStructuredSelector } from 'reselect'; import Navicon from '../components/Navicon'; import FileInput from '../components/FileInput'; import { getSettings, setCert, setKey, uploadCert } from '../state/settings'; class Settings extends PureComponent { handleCertChange = (name, data) => this.props.dispatch(setCert(name, data)); handleKeyChange = (name, data) => this.props.dispatch(setKey(name, data)); handleCertUpload = () => this.props.dispatch(uploadCert()); render() { const { settings } = this.props; const status = settings.get('uploadingCert') ? 'Uploading...' : 'Upload'; const error = settings.get('certError'); return (

Settings

Client Certificate

Certificate

Private Key

{ error ?

{error}

: null }
); } } const mapState = createStructuredSelector({ settings: getSettings }); export default connect(mapState)(Settings);