diff options
Diffstat (limited to 'client/app.jsx')
-rw-r--r-- | client/app.jsx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/client/app.jsx b/client/app.jsx new file mode 100644 index 0000000..556623f --- /dev/null +++ b/client/app.jsx @@ -0,0 +1,39 @@ +import { useState } from 'react'; +import { setConstantValue } from 'typescript'; + +const App = () => { + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + + const submit = () => { + fetch('/sign_in', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ email, password }), + }); + }; + + return ( + <> + <div> + <input + type="email" + value={email} + onChange={(e) => setEmail(e.target.value)} + /> + </div> + <div> + <input + type="password" + value={password} + onChange={(e) => setPassword(e.target.value)} + /> + </div> + <button type="button" onClick={submit}>Login</button> + </> + ); +}; + +export default App; |