Skip to content

Commit

Permalink
frontend changes
Browse files Browse the repository at this point in the history
  • Loading branch information
exodus31 committed Sep 1, 2022
1 parent f7047a9 commit b4820c0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
8 changes: 5 additions & 3 deletions frontend/src/Components/Dailyprob.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useLocation } from "react-router-dom";

function Dailyprob() {
const token = localStorage.getItem("token");
if (!token) {
if (token) {
window.location.href = "/login";
}
const today = new Date();
Expand All @@ -22,7 +22,7 @@ function Dailyprob() {
return (
<div>
<div className="container contpast">
<h3 className="upcomingContestHead" align="center">Today's Problems</h3>
<h3 className="upcomingContestHead mt-4" align="center">Today's Problems</h3>
<div className="card carddp container mt-4">
{posts.map((post, id) => {
const date = new Date(post.date);
Expand All @@ -31,9 +31,10 @@ function Dailyprob() {
<div className="dp" key={id}>
{id != 0 ? <hr /> : <></>}
<h3>Daily {post.name}</h3>
<a href="{post.link}"><button className="btnviewp">Solve Problem</button></a>
<p>{post.date}</p>
</div>
);
);
} else {
return <></>;
}
Expand All @@ -48,6 +49,7 @@ function Dailyprob() {
<div className="dp" key={id}>
{id != 0 ? <hr /> : <></>}
<h3>Daily {post.name}</h3>
<a href="{post.link}"><button className="btnviewp">Solve Problem</button></a>
<p>{post.date}</p>
</div>
);
Expand Down
13 changes: 12 additions & 1 deletion frontend/src/Components/Style.css
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,18 @@ table{
.td1{
text-align: center;
}

.btnviewp{
float: right;
font-size: 20px;
margin-top: 5px;
margin-right: 10px;
border-radius: 5px;
border: none;
background-color: rgb(44, 50, 76);
box-shadow: 2px 2px 5px black;
color: white;
padding: 10px;
}
.h2x{
color: white !important;
margin-top: 20px;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/Components/Yourprofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import moment from "moment";

function Yourprofile() {
const token = localStorage.getItem("token");
if (!token) {
if (token) {
window.location.href = "/login";
}
const [state, setState] = React.useState(false);
Expand Down Expand Up @@ -191,7 +191,7 @@ function Yourprofile() {
<div className="dp" key={id}>
<h3>
Daily {post.username}
<button className="btndp">{post.link}</button>
<a href="{post.link}"><button className="btnviewp">Solve Problem</button></a>
</h3>
<hr />
</div>
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/Components/data2.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default [
desc:"uygfwgifue ygr grsth jgiorelkhmgkr;k hgsarios",
points:22,
date:"20-2-22",
link:"urqiegiuhi./fekjh.ekj"
link:"Solve Problem >"
},
{
id:5,
Expand All @@ -42,7 +42,7 @@ export default [
desc:"uygfwgifue ygr grsth jgiorelkhmgkr;k hgsarios",
points:22,
date:"20-2-22",
link:"urqiegiuhi./fekjh.ekj"
link:"Solve Problem >"
},
{
id:6,
Expand All @@ -51,7 +51,7 @@ export default [
desc:"uygfwgifue ygr grsth jgiorelkhmgkr;k hgsarios",
points:22,
date:"20-2-22",
link:"urqiegiuhi./fekjh.ekj"
link:"Solve Problem >"
},
{
id:7,
Expand All @@ -60,7 +60,7 @@ export default [
desc:"uygfwgifue ygr grsth jgiorelkhmgkr;k hgsarios",
points:22,
date:"20-2-22",
link:"urqiegiuhi./fekjh.ekj"
link:"Solve Problem >"
},
{
id:8,
Expand All @@ -69,7 +69,7 @@ export default [
desc:"uygfwgifue ygr grsth jgiorelkhmgkr;k hgsarios",
points:22,
date:"20-2-22",
link:"urqiegiuhi./fekjh.ekj"
link:"Solve Problem >"
},
{
id:9,
Expand All @@ -78,7 +78,7 @@ export default [
desc:"uygfwgifue ygr grsth jgiorelkhmgkr;k hgsarios",
points:22,
date:"20-2-22",
link:"urqiegiuhi./fekjh.ekj"
link:"Solve Problem >"
},
{
id:10,
Expand All @@ -87,6 +87,6 @@ export default [
desc:"uygfwgifue ygr grsth jgiorelkhmgkr;k hgsarios",
points:22,
date:"20-2-22",
link:"urqiegiuhi./fekjh.ekj"
link:"Solve Problem >"
},
]

0 comments on commit b4820c0

Please sign in to comment.