From e9514a82b0321fa60de1db675625f5201334513e Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Mon, 21 Mar 2022 23:42:23 +0200 Subject: [PATCH] pages --- client/src/pages/Home.js | 4 +- client/src/pages/Login.js | 57 +++++++++++++++++++++++++++ client/src/pages/Media.js | 81 ++++++++++++++++++++++++++++---------- client/src/pages/Panel.js | 83 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 203 insertions(+), 22 deletions(-) create mode 100644 client/src/pages/Login.js create mode 100644 client/src/pages/Panel.js diff --git a/client/src/pages/Home.js b/client/src/pages/Home.js index 5b51ab1..8588af3 100644 --- a/client/src/pages/Home.js +++ b/client/src/pages/Home.js @@ -1,4 +1,6 @@ +/* eslint-disable react/no-unescaped-entities */ import '../css/Home.css'; +import React from 'react'; const Home = () => { return ( @@ -26,6 +28,6 @@ const Home = () => { ); -} +}; export default Home; diff --git a/client/src/pages/Login.js b/client/src/pages/Login.js new file mode 100644 index 0000000..6df347e --- /dev/null +++ b/client/src/pages/Login.js @@ -0,0 +1,57 @@ +/* eslint-disable react/no-unescaped-entities */ +import React from 'react'; +import { useLocation, useNavigate } from 'react-router-dom'; +import '../css/Login.css'; +import { useLoginContext } from '../Structures/UserContext'; +import { login } from '../util/Util'; + +const LoginPage = () => { + + const location = useLocation(); + const navigate = useNavigate(); + const [, updateUser] = useLoginContext(); + const from = location.state?.from?.pathname || '/'; + + const _login = async () => { + + await login(); + //window.location.replace(`${proto}://${options.domain}/api/login`); + updateUser(); + navigate(from, {replace: true}); + + }; + + return ( +
+ +

+ Woah! You found the """secret""" page. ;) +

+ +

+ You probably want to click that button. Can't really blame you, curiosity and all that. +

+ +

+ Unfortunately for you it won't really do much for you. Or will it? +

+ +

+ No, really, it won't do anything for you. +

+ +

+ or... does it...? +

+ +

+ Only one way to find out, I guess... +

+ + +
+ ); + +}; + +export default LoginPage; \ No newline at end of file diff --git a/client/src/pages/Media.js b/client/src/pages/Media.js index 0d2e4fe..c4ebfca 100644 --- a/client/src/pages/Media.js +++ b/client/src/pages/Media.js @@ -1,41 +1,80 @@ -import { useEffect, useRef, useState } from 'react' -import '../css/Media.css' -const MediaComponent = ({src, width}) => { +import React, { useEffect, useRef, useState } from 'react'; +import '../css/Media.css'; + +const ClipEntry = ({ name, filename, uploader, thumbnail, duration, clickHandler }) => { + + const _uploader = `${ uploader.tag } (${ uploader.id })`; return ( -
-