[ATL-1533] Firmware&Certificate Uploader (#469)

Co-authored-by: Alberto Iannaccone <a.iannaccone@arduino.cc>
This commit is contained in:
Francesco Stasi
2021-08-25 10:36:51 +02:00
committed by GitHub
parent 6233e1fa98
commit 302fb7b6af
37 changed files with 20276 additions and 19 deletions

View File

@@ -0,0 +1,37 @@
import * as React from 'react';
export const CertificateAddComponent = ({
addCertificate,
}: {
addCertificate: (cert: string) => void;
}): React.ReactElement => {
const [value, setValue] = React.useState('');
const handleChange = React.useCallback((event) => {
setValue(event.target.value);
}, []);
return (
<form
className="certificate-add"
onSubmit={(event) => {
event.preventDefault();
event.stopPropagation();
addCertificate(value);
setValue('');
}}
>
<label>
<div>Add URL to fetch SSL certificate</div>
<input
className="theia-input"
placeholder="Enter URL"
type="text"
name="add"
onChange={handleChange}
value={value}
/>
</label>
</form>
);
};