From 826c7c47785ee01d2b9267919132ada696425344 Mon Sep 17 00:00:00 2001 From: Melonai Date: Wed, 20 Jan 2021 23:18:09 +0100 Subject: Remade the client in SvelteKit --- client/src/Components/Form.js | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 client/src/Components/Form.js (limited to 'client/src/Components/Form.js') diff --git a/client/src/Components/Form.js b/client/src/Components/Form.js deleted file mode 100644 index 979d9c9..0000000 --- a/client/src/Components/Form.js +++ /dev/null @@ -1,39 +0,0 @@ -import React, {useState} from 'react'; -import Button from './Button'; -import isURL from "validator/lib/isURL"; - -function Form(props) { - const [state, setState] = useState({value: '', valid: false}); - - const handleSubmit = () => { - if (state.valid) { - props.addRequest(state.value); - } - }; - - const handleChange = e => { - const userInput = e.target.value; - const valid = isURL('https://' + userInput); - setState({value: userInput, valid: valid}); - }; - - const handlePaste = e => { - e.preventDefault(); - const pattern = /^https?:\/\//; - setState({value: e.clipboardData.getData('Text').replace(pattern, ''), valid: false}); - }; - - return ( -
e.preventDefault()}> -
-
- https:// - -
-
-
- ) -} - -export default Form; \ No newline at end of file -- cgit 1.4.1