Skip to content

Commit

Permalink
refactor(misc) : moved test pages and added enums(#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
2ood committed Mar 15, 2023
1 parent 2c90022 commit 4a0b5c0
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 7 deletions.
5 changes: 4 additions & 1 deletion frontend/src/components/LecturePlayer.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import * as Styled from "styles/ComponentStyles";
import blackboard from "img/blackboard-compressed.jpg";

function LecturePlayer(props){
const src = `https://www.youtube.com/embed/${props.video_id}`;
return (
<Styled.LecturePlayer src={src} title="Youtube Video Player" allow="accelerometer; autoplay; fullscreen; clipboard-write; encrypted-media; gyroscope; picture-in-picture"></Styled.LecturePlayer>
props.video_id
?<Styled.LecturePlayer src={src} title="Youtube Video Player" allow="accelerometer; autoplay; fullscreen; clipboard-write; encrypted-media; gyroscope; picture-in-picture"></Styled.LecturePlayer>
:<img alt="lecture-thumb" src={blackboard}/>
)
}

Expand Down
22 changes: 22 additions & 0 deletions frontend/src/components/ThemedToast.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ToastContainer } from "react-toastify";
import 'react-toastify/dist/ReactToastify.css';


function ThemedToast(){
return (
<ToastContainer
position="bottom-center"
autoClose={1500}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover
theme="light"
/>
)
}

export default ThemedToast;
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react";
import * as Component from "components/Components";
import * as Styled from "styles/ComponentStyles";
import { useNavigate } from 'react-router-dom';
import { FE_PATH } from "util/Enums";



Expand All @@ -12,11 +13,11 @@ function TestPage(){
<Component.Topbar />
<Styled.MainBodyFrame gap="30px">
<Styled.UnderlinedTitle size="100%" fontSize="h1" align="center">Page Overview</Styled.UnderlinedTitle>
<Styled.ThemedButton size="100%" theme="secondary" onClick={()=>{navigate("/certificate")}}>Certificate Page</Styled.ThemedButton>
<Styled.ThemedButton size="100%" theme="secondary" onClick={()=>{navigate("/lecture/upload")}}>Lecture Upload Page</Styled.ThemedButton>
<Styled.ThemedButton size="100%" theme="secondary" onClick={()=>{navigate("/lecture/view")}}>Lecture View Page</Styled.ThemedButton>
<Styled.ThemedButton size="100%" theme="secondary" onClick={()=>{navigate("/lecture/list")}}>Lecture Rooms Page</Styled.ThemedButton>
<Styled.ThemedButton size="100%" theme="secondary" onClick={()=>{navigate("/mypage")}}>Mypage</Styled.ThemedButton>
<Styled.ThemedButton size="100%" theme="secondary" onClick={()=>{navigate(FE_PATH.mypage.certificate)}}>Certificate Page</Styled.ThemedButton>
<Styled.ThemedButton size="100%" theme="secondary" onClick={()=>{navigate(FE_PATH.course.upload)}}>Lecture Upload Page</Styled.ThemedButton>
<Styled.ThemedButton size="100%" theme="secondary" onClick={()=>{navigate(FE_PATH.course.view)}}>Lecture View Page</Styled.ThemedButton>
<Styled.ThemedButton size="100%" theme="secondary" onClick={()=>{navigate(FE_PATH.course.list)}}>Lecture Rooms Page</Styled.ThemedButton>
<Styled.ThemedButton size="100%" theme="secondary" onClick={()=>{navigate(FE_PATH.mypage)}}>Mypage</Styled.ThemedButton>
</Styled.MainBodyFrame>
</>);
}
Expand Down
23 changes: 22 additions & 1 deletion frontend/src/util/Enums.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@ const HOST = {
"port" : 8080
}

const FE_PATH = {
main : "",
auth : {
signin : "/sign-in",
signup : "/sign-up"
},

mypage : {
mypage : "/mypage",
certificate : "/certificate"
},
course : {
upload : "/course/upload",
list : "/course/list",
view : "/course/view"
}
};

const BE_PATH = {

};


export {METHOD, HOST};
export {METHOD, HOST, FE_PATH, BE_PATH};

0 comments on commit 4a0b5c0

Please sign in to comment.