diff --git a/client/src/App.css b/client/src/App.css index 35ac68f..f8c8f40 100644 --- a/client/src/App.css +++ b/client/src/App.css @@ -15,7 +15,6 @@ p , a { .flex-row { display: flex; - justify-content: center; align-items: center; flex-direction: row; } diff --git a/client/src/Components/AllProblems/AllProblems.jsx b/client/src/Components/AllProblems/AllProblems.jsx index 1e16e6b..3db1215 100644 --- a/client/src/Components/AllProblems/AllProblems.jsx +++ b/client/src/Components/AllProblems/AllProblems.jsx @@ -1,50 +1,70 @@ import React, {useEffect, useState} from 'react' -import { Link } from 'react-router-dom' +import {Link} from 'react-router-dom' import "./AllProblems.css" -import { backendUrl } from "../../constants.js"; +import {backendUrl} from "../../constants.js"; +import Loader from "../../Constants/Loader/Loader.jsx"; const AllProblemsPage = () => { - const [problems, setProblems] = useState([]); - - const init = async () => { - const response = await fetch(`${backendUrl}/problems`, { - method: "GET", - }); - - const json = await response.json(); - setProblems(json.problems); - } - - useEffect(() => { - init() - }, []); - - return ( -
| Title | -Difficulty | -Acceptance | -
|---|---|---|
| {prob.title} | - -{prob.difficulty} | -{prob.acceptance} | -
{problem.description}
-Input : {problem.exampleIn}
- Output : {problem.exampleOut}
+
+ function renderDescription() {
+ if (activeTab !== "description") {
+ setActiveTab("description")
+ setIsSubmissionsLoaded(false)
+ }
+ return (
+ {problem.description}
+Input : {problem.exampleIn}
+ Output : {problem.exampleOut}
| {s.status} | +{s.submission} | +