diff options
| -rw-r--r-- | .env.development | 1 | ||||
| -rw-r--r-- | .env.production | 1 | ||||
| -rw-r--r-- | src/components/CloseWindow.tsx | 13 | ||||
| -rw-r--r-- | src/components/Layout.tsx | 5 | ||||
| -rw-r--r-- | src/routes/index.tsx | 3 |
5 files changed, 21 insertions, 2 deletions
diff --git a/.env.development b/.env.development index 93fd70c..988eaa6 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,4 @@ # .env.development VITE_API_TITLE=http://localhost:3000 VITE_BOXEDAPI_TITLE=http://localhost:3000 +VITE_GITHUB_CLIENTID=74468ad0847e527262d9 diff --git a/.env.production b/.env.production index 0363aa3..3305cac 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,4 @@ # .env.production VITE_API_TITLE=https://gameholster.malcz.com VITE_BOXEDAPI_TITLE=https://gameholster.boxed.fun +VITE_GITHUB_CLIENTID=Ov23lilvF2QoyDWyY4mr diff --git a/src/components/CloseWindow.tsx b/src/components/CloseWindow.tsx new file mode 100644 index 0000000..247e794 --- /dev/null +++ b/src/components/CloseWindow.tsx @@ -0,0 +1,13 @@ +//import { Link } from "react-router-dom"; + +//export default () => ( +export default function Home () { + + window.close(); + window.location.replace("/"); + + return( + <> + </> + ); +} diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index fe961cf..960e112 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -5,13 +5,16 @@ export type userData = { userData: { name: string } }; export default function Layout ({userData}: userData) { + const loginLink = () => { + window.open(`https://github.com/login/oauth/authorize?client_id=${import.meta.env.VITE_GITHUB_CLIENTID}`); + }; return ( <> <div id="page" className="star flex flex-row min-h-screen max-h-screen bg-amber-400 text-stone-950 text-xl bg-star bg-repeat bg-[length:170px_170px]"> <div id="sidebar" className="flex flex-row shrink-0 grow-0 h-vh w-64 items-top bg-stone-800"> <nav id="sidebar-content" dir="rtl" className="text-stone-50 p-6 w-full h-screen overflow-y-auto overflow-x-hidden"> <div dir='ltr'> - { userData.name ? <div className="flex items-end gap-2 pb-2"> <div className="text-xs"> Logged in as: </div> <div>{userData.name}</div> </div> : <a href="https://github.com/login/oauth/authorize?client_id=Ov23lilvF2QoyDWyY4mr" className="pb-2"> Login with Github </a> /* 74468ad0847e527262d9 */ } + { userData.name ? <div className="flex items-end gap-2 pb-2"> <div className="text-xs"> Logged in as: </div> <div>{userData.name}</div> </div> : <a href="" onClick={loginLink} className="pb-2"> Login with Github </a> } <div className="text-3xl py-10 text-center font-title">Tradam</div> <div className="flex flex-col items-center gap-1"> <Button link={ <Link to="/" className="absolute flex top-0 left-0 w-36 h-16 text-stone-50 bg-transparent justify-center items-center" role="button"><div className="h-min">About Me</div></Link> }/> diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 4c2a666..d653bce 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -6,6 +6,7 @@ import Games from "../components/Games"; import UploadGame from "../components/UploadGame"; import Game from "../components/Game"; import Layout from "../components/Layout"; +import CloseWindow from "../components/CloseWindow"; export default function Index() { @@ -31,8 +32,8 @@ export default function Index() <Route path="/blogs" element={<Blogs />} /> <Route path="/games" element={<Games />} /> <Route path="/games/upload" element={<UploadGame />} /> - {/*<Route path="/games/upload" element={<GamesUpload />} />*/} <Route path="/game/:game" element={<Game />} /> + <Route path="/closewindow" element={<CloseWindow />} /> </Route> </Routes> </Router> |
