dispatch/client/src/js/components/pages/Settings.js

35 lines
913 B
JavaScript
Raw Normal View History

import React from 'react';
import Navicon from 'containers/Navicon';
import FileInput from 'components/ui/FileInput';
const Settings = ({ settings, onCertChange, onKeyChange, uploadCert }) => {
2018-04-25 03:36:27 +00:00
const status = settings.uploadingCert ? 'Uploading...' : 'Upload';
const error = settings.certError;
return (
<div className="settings">
<Navicon />
<h1>Settings</h1>
<h2>Client Certificate</h2>
<div>
<p>Certificate</p>
<FileInput
2018-04-25 03:36:27 +00:00
name={settings.certFile || 'Select Certificate'}
onChange={onCertChange}
/>
</div>
<div>
<p>Private Key</p>
<FileInput
2018-04-25 03:36:27 +00:00
name={settings.keyFile || 'Select Key'}
onChange={onKeyChange}
/>
</div>
<button onClick={uploadCert}>{status}</button>
2018-04-05 23:46:22 +00:00
{error ? <p className="error">{error}</p> : null}
</div>
);
};
export default Settings;