Clean up container/component relationship
This commit is contained in:
parent
8b0a53b375
commit
993d29242e
22 changed files with 384 additions and 372 deletions
34
client/src/js/components/pages/Settings.js
Normal file
34
client/src/js/components/pages/Settings.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
import React from 'react';
|
||||
import Navicon from '../../containers/Navicon';
|
||||
import FileInput from '../FileInput';
|
||||
|
||||
const Settings = ({ settings, onCertChange, onKeyChange, uploadCert }) => {
|
||||
const status = settings.get('uploadingCert') ? 'Uploading...' : 'Upload';
|
||||
const error = settings.get('certError');
|
||||
|
||||
return (
|
||||
<div className="settings">
|
||||
<Navicon />
|
||||
<h1>Settings</h1>
|
||||
<h2>Client Certificate</h2>
|
||||
<div>
|
||||
<p>Certificate</p>
|
||||
<FileInput
|
||||
name={settings.get('certFile') || 'Select Certificate'}
|
||||
onChange={onCertChange}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<p>Private Key</p>
|
||||
<FileInput
|
||||
name={settings.get('keyFile') || 'Select Key'}
|
||||
onChange={onKeyChange}
|
||||
/>
|
||||
</div>
|
||||
<button onClick={uploadCert}>{status}</button>
|
||||
{ error ? <p className="error">{error}</p> : null }
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Settings;
|
Loading…
Add table
Add a link
Reference in a new issue