Update card & dashboard
This commit is contained in:
parent
79dc7eef07
commit
da139e88e7
7 changed files with 163 additions and 123 deletions
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"typescript.tsdk": "node_modules\\.pnpm\\typescript@4.9.5\\node_modules\\typescript\\lib",
|
"typescript.tsdk": "node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib",
|
||||||
"typescript.enablePromptUseWorkspaceTsdk": true
|
"typescript.enablePromptUseWorkspaceTsdk": true
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@ import Wrapper from '@/ui/dashboard/Wrapper';
|
||||||
|
|
||||||
export default function Layout({ children }: { children: ReactNode }) {
|
export default function Layout({ children }: { children: ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen flex-col">
|
<div className="flex h-screen w-full flex-col">
|
||||||
<Wrapper>{children}</Wrapper>
|
<Wrapper>{children}</Wrapper>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -3,34 +3,29 @@ import CardTable from '@/ui/CardTable';
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen w-full">
|
<div className="flex h-full w-full flex-col justify-between space-y-4">
|
||||||
<div className="">
|
<div className="flex flex-col space-y-6">
|
||||||
<h1 className="text-2xl font-bold tracking-tight">Statistique</h1>
|
<div className="flex flex-col space-y-2">
|
||||||
<div className="flex flex-col space-x-0 pt-5 md:flex-row md:space-x-9">
|
<h2 className="text-2xl">Bienvenue!</h2>
|
||||||
<Card />
|
<p className="text-muted">Ceci est la page d'accueil du dashboard</p>
|
||||||
<Card />
|
|
||||||
<Card />
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex h-[60%] flex-col space-x-0 pt-5 md:flex-row md:space-x-[5%]">
|
<section className="flex justify-between space-x-4">
|
||||||
<div className="mb-9 w-6/12">
|
<Card />
|
||||||
<h1 className="text-2xl font-bold tracking-tight">Guide</h1>
|
<Card />
|
||||||
<div className="flex h-full flex-col space-x-0 pt-5 md:flex-row md:space-x-[10%] ">
|
<Card />
|
||||||
<div className="h-full w-full rounded-lg bg-dark shadow-md">
|
</section>
|
||||||
<div className="flex justify-between rounded-lg py-2 px-4">
|
|
||||||
<div className="my-auto">
|
<div className="flex">
|
||||||
<p className="font-bold">Bold data</p>
|
<section className="flex max-h-96 w-full space-y-4">
|
||||||
<p className="text-lg">Simple data</p>
|
<div className="flex justify-between space-x-4">
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="mb-9 w-6/12">
|
|
||||||
<h1 className="text-2xl font-bold tracking-tight">Dernières activités </h1>
|
|
||||||
<div className="flex h-full flex-col space-x-0 pt-5 md:flex-row md:space-x-[10%]">
|
|
||||||
<CardTable />
|
<CardTable />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
|
<section className="flex max-h-96 w-full space-y-4">
|
||||||
|
<div className="flex justify-between space-x-4">
|
||||||
|
<CardTable />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import Puzzles from '@/ui/Puzzles';
|
import Puzzles from '@/ui/Puzzles';
|
||||||
import SWRFallback from '@/ui/SWRFallback';
|
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
// const puzzles = await getPuzzles();
|
// const puzzles = await getPuzzles();
|
||||||
|
|
20
ui/Card.tsx
20
ui/Card.tsx
|
@ -1,12 +1,8 @@
|
||||||
export default function Card() {
|
export default function Card({ title = 'Title', data = 'Data' }) {
|
||||||
return (
|
return (
|
||||||
<div className="w-96 h-20 bg-dark rounded-lg shadow-md mb-9">
|
<div className="flex w-full flex-col rounded-lg border-2 border-highlight-primary bg-primary-700 p-4 shadow-md">
|
||||||
<div className="flex w-full h-full py-2 px-4 rounded-lg justify-between">
|
<p className="font-bold">{title}</p>
|
||||||
<div className="my-auto">
|
<p className="text-lg">{data}</p>
|
||||||
<p className="font-bold">Bold data</p>
|
</div>
|
||||||
<p className="text-lg">Simple data</p>
|
);
|
||||||
</div>
|
}
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
214
ui/CardTable.tsx
214
ui/CardTable.tsx
|
@ -1,8 +1,10 @@
|
||||||
|
import AppLink from './AppLink';
|
||||||
|
|
||||||
export default function CardTable() {
|
export default function CardTable() {
|
||||||
return (
|
return (
|
||||||
<div className="relative w-full overflow-x-auto border-2 border-dark/60 bg-dark shadow-md sm:rounded-lg">
|
<div className="relative w-full overflow-x-auto border-2 border-highlight-primary bg-primary-700 shadow-md sm:rounded-lg">
|
||||||
<table className="w-full text-left text-sm text-gray-500 dark:text-gray-400 ">
|
<table className="w-full text-left text-sm text-muted ">
|
||||||
<thead className="z-1 sticky top-0 bg-light-dark text-xs uppercase text-white">
|
<thead className="z-1 sticky top-0 bg-primary-600 text-xs uppercase text-white">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col" className="px-6 py-3">
|
<th scope="col" className="px-6 py-3">
|
||||||
Exercice
|
Exercice
|
||||||
|
@ -22,164 +24,212 @@ export default function CardTable() {
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr className=" border-b bg-dark hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-600">
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
<th
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
scope="row"
|
|
||||||
className="whitespace-nowrap px-6 py-4 font-medium text-gray-900 dark:text-white"
|
|
||||||
>
|
|
||||||
Exercice 1
|
Exercice 1
|
||||||
</th>
|
</th>
|
||||||
<td className="px-6 py-4">30</td>
|
<td className="px-6 py-4">30</td>
|
||||||
<td className="px-6 py-4">300</td>
|
<td className="px-6 py-4">300</td>
|
||||||
<td className="px-6 py-4">10/10/2010</td>
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
<td className="px-6 py-4 text-right">
|
<td className="px-6 py-4 text-right">
|
||||||
<a href="#" className="font-medium text-blue-600 hover:underline dark:text-blue-500">
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
Reprendre
|
Reprendre
|
||||||
</a>
|
</AppLink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="border-b bg-dark hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-600">
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
<th
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
scope="row"
|
|
||||||
className="whitespace-nowrap px-6 py-4 font-medium text-gray-900 dark:text-white"
|
|
||||||
>
|
|
||||||
Exercice 1
|
Exercice 1
|
||||||
</th>
|
</th>
|
||||||
<td className="px-6 py-4">40</td>
|
<td className="px-6 py-4">30</td>
|
||||||
<td className="px-6 py-4">300</td>
|
<td className="px-6 py-4">300</td>
|
||||||
<td className="px-6 py-4">10/10/2010</td>
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
<td className="px-6 py-4 text-right">
|
<td className="px-6 py-4 text-right">
|
||||||
<a href="#" className="font-medium text-blue-600 hover:underline dark:text-blue-500">
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
Reprendre
|
Reprendre
|
||||||
</a>
|
</AppLink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-dark hover:bg-gray-50 dark:hover:bg-gray-600">
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
<th
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
scope="row"
|
|
||||||
className="whitespace-nowrap px-6 py-4 font-medium text-gray-900 dark:text-white"
|
|
||||||
>
|
|
||||||
Exercice 1
|
Exercice 1
|
||||||
</th>
|
</th>
|
||||||
<td className="px-6 py-4">60</td>
|
<td className="px-6 py-4">30</td>
|
||||||
<td className="px-6 py-4">300</td>
|
<td className="px-6 py-4">300</td>
|
||||||
<td className="px-6 py-4">10/10/2010</td>
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
<td className="px-6 py-4 text-right">
|
<td className="px-6 py-4 text-right">
|
||||||
<a href="#" className="font-medium text-blue-600 hover:underline dark:text-blue-500">
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
Reprendre
|
Reprendre
|
||||||
</a>
|
</AppLink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-dark hover:bg-gray-50 dark:hover:bg-gray-600">
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
<th
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
scope="row"
|
|
||||||
className="whitespace-nowrap px-6 py-4 font-medium text-gray-900 dark:text-white"
|
|
||||||
>
|
|
||||||
Exercice 1
|
Exercice 1
|
||||||
</th>
|
</th>
|
||||||
<td className="px-6 py-4">60</td>
|
<td className="px-6 py-4">30</td>
|
||||||
<td className="px-6 py-4">300</td>
|
<td className="px-6 py-4">300</td>
|
||||||
<td className="px-6 py-4">10/10/2010</td>
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
<td className="px-6 py-4 text-right">
|
<td className="px-6 py-4 text-right">
|
||||||
<a href="#" className="font-medium text-blue-600 hover:underline dark:text-blue-500">
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
Reprendre
|
Reprendre
|
||||||
</a>
|
</AppLink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-dark hover:bg-gray-50 dark:hover:bg-gray-600">
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
<th
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
scope="row"
|
|
||||||
className="whitespace-nowrap px-6 py-4 font-medium text-gray-900 dark:text-white"
|
|
||||||
>
|
|
||||||
Exercice 1
|
Exercice 1
|
||||||
</th>
|
</th>
|
||||||
<td className="px-6 py-4">60</td>
|
<td className="px-6 py-4">30</td>
|
||||||
<td className="px-6 py-4">300</td>
|
<td className="px-6 py-4">300</td>
|
||||||
<td className="px-6 py-4">10/10/2010</td>
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
<td className="px-6 py-4 text-right">
|
<td className="px-6 py-4 text-right">
|
||||||
<a href="#" className="font-medium text-blue-600 hover:underline dark:text-blue-500">
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
Reprendre
|
Reprendre
|
||||||
</a>
|
</AppLink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-dark hover:bg-gray-50 dark:hover:bg-gray-600">
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
<th
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
scope="row"
|
|
||||||
className="whitespace-nowrap px-6 py-4 font-medium text-gray-900 dark:text-white"
|
|
||||||
>
|
|
||||||
Exercice 1
|
Exercice 1
|
||||||
</th>
|
</th>
|
||||||
<td className="px-6 py-4">60</td>
|
<td className="px-6 py-4">30</td>
|
||||||
<td className="px-6 py-4">300</td>
|
<td className="px-6 py-4">300</td>
|
||||||
<td className="px-6 py-4">10/10/2010</td>
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
<td className="px-6 py-4 text-right">
|
<td className="px-6 py-4 text-right">
|
||||||
<a href="#" className="font-medium text-blue-600 hover:underline dark:text-blue-500">
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
Reprendre
|
Reprendre
|
||||||
</a>
|
</AppLink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-dark hover:bg-gray-50 dark:hover:bg-gray-600">
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
<th
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
scope="row"
|
|
||||||
className="whitespace-nowrap px-6 py-4 font-medium text-gray-900 dark:text-white"
|
|
||||||
>
|
|
||||||
Exercice 1
|
Exercice 1
|
||||||
</th>
|
</th>
|
||||||
<td className="px-6 py-4">60</td>
|
<td className="px-6 py-4">30</td>
|
||||||
<td className="px-6 py-4">300</td>
|
<td className="px-6 py-4">300</td>
|
||||||
<td className="px-6 py-4">10/10/2010</td>
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
<td className="px-6 py-4 text-right">
|
<td className="px-6 py-4 text-right">
|
||||||
<a href="#" className="font-medium text-blue-600 hover:underline dark:text-blue-500">
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
Reprendre
|
Reprendre
|
||||||
</a>
|
</AppLink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-dark hover:bg-gray-50 dark:hover:bg-gray-600">
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
<th
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
scope="row"
|
|
||||||
className="whitespace-nowrap px-6 py-4 font-medium text-gray-900 dark:text-white"
|
|
||||||
>
|
|
||||||
Exercice 1
|
Exercice 1
|
||||||
</th>
|
</th>
|
||||||
<td className="px-6 py-4">60</td>
|
<td className="px-6 py-4">30</td>
|
||||||
<td className="px-6 py-4">300</td>
|
<td className="px-6 py-4">300</td>
|
||||||
<td className="px-6 py-4">10/10/2010</td>
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
<td className="px-6 py-4 text-right">
|
<td className="px-6 py-4 text-right">
|
||||||
<a href="#" className="font-medium text-blue-600 hover:underline dark:text-blue-500">
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
Reprendre
|
Reprendre
|
||||||
</a>
|
</AppLink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-dark hover:bg-gray-50 dark:hover:bg-gray-600">
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
<th
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
scope="row"
|
|
||||||
className="whitespace-nowrap px-6 py-4 font-medium text-gray-900 dark:text-white"
|
|
||||||
>
|
|
||||||
Exercice 1
|
Exercice 1
|
||||||
</th>
|
</th>
|
||||||
<td className="px-6 py-4">60</td>
|
<td className="px-6 py-4">30</td>
|
||||||
<td className="px-6 py-4">300</td>
|
<td className="px-6 py-4">300</td>
|
||||||
<td className="px-6 py-4">10/10/2010</td>
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
<td className="px-6 py-4 text-right">
|
<td className="px-6 py-4 text-right">
|
||||||
<a href="#" className="font-medium text-blue-600 hover:underline dark:text-blue-500">
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
Reprendre
|
Reprendre
|
||||||
</a>
|
</AppLink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="bg-dark hover:bg-gray-50 dark:hover:bg-gray-600">
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
<th
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
scope="row"
|
|
||||||
className="whitespace-nowrap px-6 py-4 font-medium text-gray-900 dark:text-white"
|
|
||||||
>
|
|
||||||
Exercice 1
|
Exercice 1
|
||||||
</th>
|
</th>
|
||||||
<td className="px-6 py-4">60</td>
|
<td className="px-6 py-4">30</td>
|
||||||
<td className="px-6 py-4">300</td>
|
<td className="px-6 py-4">300</td>
|
||||||
<td className="px-6 py-4">10/10/2010</td>
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
<td className="px-6 py-4 text-right">
|
<td className="px-6 py-4 text-right">
|
||||||
<a href="#" className="font-medium text-blue-600 hover:underline dark:text-blue-500">
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
Reprendre
|
Reprendre
|
||||||
</a>
|
</AppLink>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
|
Exercice 1
|
||||||
|
</th>
|
||||||
|
<td className="px-6 py-4">30</td>
|
||||||
|
<td className="px-6 py-4">300</td>
|
||||||
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
|
<td className="px-6 py-4 text-right">
|
||||||
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
|
Reprendre
|
||||||
|
</AppLink>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
|
Exercice 1
|
||||||
|
</th>
|
||||||
|
<td className="px-6 py-4">30</td>
|
||||||
|
<td className="px-6 py-4">300</td>
|
||||||
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
|
<td className="px-6 py-4 text-right">
|
||||||
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
|
Reprendre
|
||||||
|
</AppLink>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr className="bg-primary-700 hover:bg-primary-800 ">
|
||||||
|
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
|
||||||
|
Exercice 1
|
||||||
|
</th>
|
||||||
|
<td className="px-6 py-4">30</td>
|
||||||
|
<td className="px-6 py-4">300</td>
|
||||||
|
<td className="px-6 py-4">10/10/2010</td>
|
||||||
|
<td className="px-6 py-4 text-right">
|
||||||
|
<AppLink
|
||||||
|
href="dashboard/puzzles/1"
|
||||||
|
className="font-medium text-brand hover:underline"
|
||||||
|
>
|
||||||
|
Reprendre
|
||||||
|
</AppLink>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -16,7 +16,7 @@ export default function Usernav({ isOpen, toggle }: { isOpen: boolean; toggle: (
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="z-50 flex flex-row items-center justify-between border-b border-solid border-highlight-primary bg-secondary py-4 px-8">
|
<div className="z-50 flex w-full flex-row items-center justify-between border-b border-solid border-highlight-primary bg-secondary py-4 px-8">
|
||||||
<div className="flex flex-row items-center space-x-2 sm:space-x-0">
|
<div className="flex flex-row items-center space-x-2 sm:space-x-0">
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<button onClick={toggle} className="block sm:hidden">
|
<button onClick={toggle} className="block sm:hidden">
|
||||||
|
|
Loading…
Add table
Reference in a new issue