summaryrefslogtreecommitdiff
path: root/client/components/home
diff options
context:
space:
mode:
authorJoseph Ditton <jditton.atomic@gmail.com>2022-03-08 12:10:53 -0700
committerJoseph Ditton <jditton.atomic@gmail.com>2022-03-08 12:10:53 -0700
commit0f1009bf0ab0c79f480e8160a796d59e36d522fb (patch)
tree0fefd7de4f00a574ba5a695d70c9d78da778f8ac /client/components/home
parent15800f84a42b0aa53311ff88fa3d554653a2511a (diff)
downloadlocchat-0f1009bf0ab0c79f480e8160a796d59e36d522fb.tar.gz
locchat-0f1009bf0ab0c79f480e8160a796d59e36d522fb.zip
adds socket io and other socket stuff
Diffstat (limited to 'client/components/home')
-rw-r--r--client/components/home/_home.jsx4
-rw-r--r--client/components/home/ping.jsx22
2 files changed, 26 insertions, 0 deletions
diff --git a/client/components/home/_home.jsx b/client/components/home/_home.jsx
index 4b1ab46..405a968 100644
--- a/client/components/home/_home.jsx
+++ b/client/components/home/_home.jsx
@@ -4,6 +4,7 @@ import { ApiContext } from '../../utils/api_context';
import { AuthContext } from '../../utils/auth_context';
import { RolesContext } from '../../utils/roles_context';
import { Button } from '../common/button';
+import { Ping } from './ping';
export const Home = () => {
const [, setAuthToken] = useContext(AuthContext);
@@ -42,6 +43,9 @@ export const Home = () => {
Admin
</Button>
)}
+ <section>
+ <Ping />
+ </section>
</div>
);
};
diff --git a/client/components/home/ping.jsx b/client/components/home/ping.jsx
new file mode 100644
index 0000000..dd891af
--- /dev/null
+++ b/client/components/home/ping.jsx
@@ -0,0 +1,22 @@
+import { useState } from 'react';
+import { Button } from '../common/button';
+
+export const Ping = () => {
+ const [pings, setPings] = useState([]);
+ const [key, setKey] = useState('defaultkey');
+ return (
+ <>
+ <header>Ping</header>
+ <section>
+ <input
+ type="text"
+ className="border-2 border-gray-700 p-2 rounded"
+ value={key}
+ onChange={(e) => setKey(e.target.value)}
+ />
+ <Button>Ping Connect</Button>
+ <Button>Send Ping</Button>
+ </section>
+ </>
+ );
+};