Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
chore(page:problemNum): add structure and placeholder components
Browse files Browse the repository at this point in the history
  ## what
  - add structure and placeholder components

  ## how
  - divide into to big sections
    - charts
      - uses grid for display
      - 2 columns on md to larger screens
      - 1 column on smaller screens
    - table
      - uses flex for display
      - will be in flex column direction

  ## why
  - this will show how the components are laid out

  ## where
  - ./src/app/problems/[problemNum]/page.tsx

  ## usage
  • Loading branch information
Clumsy-Coder committed Jan 6, 2024
1 parent c8b0385 commit 8d6834e
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions src/app/problems/[problemNum]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
"use client";

import { useFetchProblemNum } from "@/hooks";
import { problemNumSchema } from "@/schema";
import { AxiosError } from "axios";
import { z } from "zod";

import Error from "@/components/error";
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import { useFetchProblemNum } from "@/hooks";
import { problemNumSchema } from "@/schema";


type ChartCard = {
title: string;
chart: React.ReactNode;
}
const ChartCard = ({title, chart}: ChartCard) => {
return (
<Card>
<CardHeader>
<CardTitle>{title}</CardTitle>
</CardHeader>
<CardContent>
{chart}
</CardContent>
</Card>
);
}

type problemPageProps = {
params: z.infer<typeof problemNumSchema>;
Expand Down Expand Up @@ -57,7 +84,22 @@ const ProblemPage = ({ params }: problemPageProps) => {
console.log("problem page: ", params.problemNum);
return (
<section>
<h1 className="text-3xl">Problem page: {params.problemNum}</h1>
<h1 className="text-3xl mb-4">Problem page: {params.problemNum}</h1>
<div className="grid lg:grid-cols-2 gap-4 mb-4">
<div className="w-full">
<ChartCard title="Problem Verdicts" />
</div>
<div className="w-full">
<ChartCard title="Submissions overtime" />
</div>
<div className="w-full">
<ChartCard title="Submission by language" />
</div>
</div>
<div className="flex flex-col gap-4">
<div>ranklist</div>
<div>submissions</div>
</div>
</section>
);
};
Expand Down

0 comments on commit 8d6834e

Please sign in to comment.