Skip to content

Commit

Permalink
front
Browse files Browse the repository at this point in the history
  • Loading branch information
exodus31 committed Sep 2, 2022
1 parent e0ef9e1 commit d3545e7
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 23 deletions.
3 changes: 2 additions & 1 deletion frontend/src/Components/Dailyprob.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ function Dailyprob() {
}
})}
</div>
</div>
</div>
<div className="loginend"></div>
</div>
);
}
Expand Down
20 changes: 11 additions & 9 deletions frontend/src/Components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,21 @@ function Navbar() {
<Link className="nav-link" to="/">Home <span className="sr-only">(current)</span></Link>
</li>
{token ? (
<li className="nav-item">
<Link className="nav-link" to="/contests">Contests <span className="sr-only">(current)</span></Link>
</li>
<>
<li className="nav-item">
<Link className="nav-link" to="/contests">Contests <span className="sr-only">(current)</span></Link>
</li>
<li className="nav-item">
<Link className="nav-link" to="/timeline">Schedule <span className="sr-only">(current)</span></Link>
</li>
</>
) : (
<></>
)
}
<li className="nav-item">
<Link className="nav-link" to="/about">Our Teams<span className="sr-only">(current)</span></Link>
</li>
<li className="nav-item">
<Link className="nav-link" to="/timeline">Schedule <span className="sr-only">(current)</span></Link>
</li>
</li>
{ width < "992" && !token ? (
<>
<li className="nav-item">
Expand All @@ -66,7 +68,7 @@ function Navbar() {
)
}
{ width < "992" && token ? (
<>
<>
<li className="nav-item">
<Link className="nav-link" to="/yourprofile">Your Profile <span className="sr-only">(current)</span></Link>
</li>
Expand Down Expand Up @@ -94,7 +96,7 @@ function Navbar() {
)
}
{ width >= "992" && token ? (
<>
<>
<Link to="/yourprofile">
<button className="btnnav2">Your Profile</button>
</Link>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/Style.css
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ table{
@media(max-width:768px){
.pointsHead{
font-size: 23px;
}
}
.details{
font-size: 20px;
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/Style2.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
padding-bottom: 13%;
}
.loginend{
height:42px;
height:250px;
background-color: #182b5c;
}
.navi{
Expand Down
32 changes: 26 additions & 6 deletions frontend/src/Components/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,35 @@ import React from 'react'
import {Link} from 'react-router-dom'
import axios from 'axios'

function Schedule() {

function useWindowSize() {
const [size, setSize] = React.useState([window.innerHeight, window.innerWidth]);
React.useEffect(() =>{
const handleResize = () => {
setSize([window.innerHeight, window.innerWidth]);
}
window.addEventListener("resize", handleResize);
},[])
return size;
}

function Schedule() {
const [height,width] = useWindowSize();
const [state, setState] = React.useState(false);
const [loading, setLoading] = React.useState(false);
React.useEffect(() => {
(async () => {
const res1 = await axios.get("https://p-club-iiti-cp.herokuapp.com/profile", {
headers: { token: localStorage.getItem("token") },
});
setState(res1.data)
setState(res1.data);
setLoading(true);
})();
},[]);

return (
<div className='container mt-4' style={{height:"1100px"}}>
{loading ? (
<div className="card">
<div className="card-body">
<h2 className="upcomingContestHead" align="center">Schedule Of The Course</h2>
Expand All @@ -30,15 +45,15 @@ function Schedule() {
<ul>
<li className="usli">Topic - C++ Basics I</li>
<li className="usli">Tutor - Jaskaran Singh</li>
<li className="usli">Venue - Maitreya Hall</li>
<li className="usli">Time - 4:30pm</li>
<li className="usli">Venue - Gargi Seminar Hall</li>
<li className="usli">Time - 10:15-11:45am</li>
</ul>
) : (
<ul>
<li className="usli">Topic - Binary Search + Interactive Problems</li>
<li className="usli">Tutor - Nishkarsh Luthra</li>
<li className="usli">Venue - Maitreya Hall</li>
<li className="usli">Time - 4:30pm</li>
<li className="usli">Venue - POD 1-D 105</li>
<li className="usli">Time - 10:15-11:45am</li>
</ul>
)}
</div>
Expand All @@ -51,6 +66,11 @@ function Schedule() {
<br />
<br/>
</div>
): (
<div className="loadcont" style={{height:`${height}px`}}>
<h2 align="center" className="mt-5" style={{color:"white"}}>Loading...</h2>
</div>
)}
</div>
)
}
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/Components/Yourprofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,13 @@ function Yourprofile() {
const date = new Date(note.date);
return (
<div className="col-sm-3 slidecont mt-3">
<h3>{note.name}</h3>
<h4>
<a href={note.link} target={"_blank"}>
Link
<h5>{note.name}</h5>
<br/>
<p>
<a href={note.link} target={"_blank"} style={{textDecoration: "none", color:"white", }}>
View Material
</a>
</h4>
</p>
<p>{moment(date).format("DD-MM-YYYY")}</p>
</div>
);
Expand Down

0 comments on commit d3545e7

Please sign in to comment.