diff options
| author | realtradam <[email protected]> | 2024-06-06 19:24:45 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-06-06 19:24:45 -0400 |
| commit | 34346b1fd4fffd2571374f86b16084066dc4aa2d (patch) | |
| tree | 1f147151e9b1eb9449394d5adb1827b04c4841c5 /src/routes/index.jsx | |
| parent | 7a38eef00de0bb35565dda3ddb1efa748c22ea47 (diff) | |
| download | malcz.com-34346b1fd4fffd2571374f86b16084066dc4aa2d.tar.gz malcz.com-34346b1fd4fffd2571374f86b16084066dc4aa2d.zip | |
add seperate uploading page and update match backend functionality
Diffstat (limited to 'src/routes/index.jsx')
| -rw-r--r-- | src/routes/index.jsx | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/routes/index.jsx b/src/routes/index.jsx deleted file mode 100644 index 67f76a7..0000000 --- a/src/routes/index.jsx +++ /dev/null @@ -1,38 +0,0 @@ -import React, { useState, useEffect } from "react"; -import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; -import Home from "../components/Home"; -import Blogs from "../components/Blogs"; -import Games from "../components/Games"; -import Game from "../components/Game"; -import Layout from "../components/Layout"; - -export default function index() -{ - const [userData, setUserData] = useState({}); - const url = `${import.meta.env.VITE_API_TITLE}/api/v1/auth/data`; - useEffect(() => { - fetch(url, { - credentials: "include" -}).then((response) => { - if(response.ok) { - return response.json(); - } - throw new Error("Network response was not ok."); - }).then((response) => setUserData(response.user_data));}, []); - // get user data here - // then pass it in as 'props' into the components - return (<> - {/*<h1>{userData.login}</h1>*/} - <Router> - <Routes> - <Route path="/" element = {<Layout userData={userData}/>}> - <Route index element={<Home />} /> - <Route path="/blogs" element={<Blogs />} /> - <Route path="/games" element={<Games />} /> - {/*<Route path="/games/upload" element={<GamesUpload />} />*/} - <Route path="/game/:game" element={<Game />} /> - </Route> - </Routes> - </Router> - </>); -} |
