summaryrefslogtreecommitdiff
path: root/client/app.jsx
diff options
context:
space:
mode:
authorJoseph Ditton <jditton.atomic@gmail.com>2021-11-16 19:14:46 -0700
committerJoseph Ditton <jditton.atomic@gmail.com>2021-11-16 19:14:46 -0700
commitcba40b6aff598e821199c186c5f1795e5252bab9 (patch)
treea5e4ad3bae238c3921e10956f21f84ca352c7d6d /client/app.jsx
parente5f684001370d6f6348fd26f97bc26c765deb934 (diff)
downloadlocchat-cba40b6aff598e821199c186c5f1795e5252bab9.tar.gz
locchat-cba40b6aff598e821199c186c5f1795e5252bab9.zip
separate client and server apps
Diffstat (limited to 'client/app.jsx')
-rw-r--r--client/app.jsx39
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;