WIP data fetching

This commit is contained in:
Théo 2023-02-22 23:15:53 +01:00
parent 19a8f6abc5
commit e4b1d11873
19 changed files with 473 additions and 352 deletions

View file

@ -3,9 +3,7 @@ import { type ReactNode } from 'react';
export default function Layout({ children }: { children: ReactNode }) {
return (
<div className="flex h-screen w-full">
<div className="flex h-full w-full flex-col items-center justify-center space-y-4">
{children}
</div>
<div className="flex h-full w-full flex-col items-center justify-center">{children}</div>
</div>
);
}

View file

@ -1,14 +1,9 @@
import AppLink from '@/ui/AppLink';
import Icon from '@/ui/Icon';
import UserAuthForm from '@/ui/UserAuthForm';
export default function Page() {
return (
<>
<div className="flex flex-col justify-start space-y-4">
<AppLink href="/">
<Icon name="arrow-left-line" />
</AppLink>
<h2 className="mx-auto text-xl font-bold">Connexion</h2>
<UserAuthForm />
</div>

View file

@ -1,14 +1,9 @@
import AppLink from '@/ui/AppLink';
import Icon from '@/ui/Icon';
import UserAuthForm from '@/ui/UserAuthForm';
export default function Page() {
return (
<>
<div className="flex flex-col justify-start space-y-4">
<AppLink href="/">
<Icon name="arrow-left-line" />
</AppLink>
<h2 className="mx-auto text-xl font-bold">Créer un compte</h2>
<UserAuthForm />
</div>

View file

@ -1,30 +1,47 @@
import Card from '@/ui/Card';
import CardTable from '@/ui/CardTable';
export default function Page() {
return (
<div className="flex h-screen flex-col space-y-4">
<section className="flex-col space-y-4">
<header>
<h3 className="text-xl font-semibold">Tableau de bord</h3>
<p className="text-muted">Ceci est la page d&apos;accueil du dashboard</p>
</header>
<main className="flex-col justify-between space-x-0 space-y-4 md:flex md:flex-row md:space-x-4 md:space-y-0">
<Card title={'Hey salut'} data={'Xavier il aime les pieds'} />
<Card title="Nicolas le boss" data="Car il a fait ces cartes" />
<Card title="Https" data="Une histoire d'amour avec Xav" />
</main>
</section>
<div className="flex h-full w-full flex-col space-y-4">
<div className="w-full">
<section className="flex flex-col space-y-4">
<header>
<h3 className="text-xl font-semibold">Tableau de bord</h3>
<p className="text-muted">Ceci est la page d&apos;accueil du dashboard</p>
</header>
<main className="flex-col justify-between space-x-0 space-y-4 md:flex md:flex-row md:space-x-6 md:space-y-0">
<Card icon="pie-chart-line" title="46" data="Puzzles" />
<Card icon="award-line" title="3" data="Badges" />
<Card icon="bar-chart-line" title="10 ème" data="Classement" />
</main>
</section>
</div>
<div className="h-full w-full flex-col justify-between space-x-0 space-y-4 md:flex md:flex-row md:space-x-6 md:space-y-0">
<section className="flex h-full w-full flex-col space-y-4">
<header>
<h3 className="text-xl font-semibold">Guides</h3>
</header>
<main className="h-full w-full flex-col justify-between space-x-0 space-y-4 rounded-lg border border-highlight-primary bg-primary-700 md:flex md:flex-row md:space-x-6 md:space-y-0"></main>
</section>
<section className="flex h-full w-full flex-col space-y-4">
<header>
<h3 className="text-xl font-semibold">Historiques</h3>
</header>
<main className="h-full w-full flex-col justify-between space-x-0 space-y-4 rounded-lg border border-highlight-primary bg-primary-700 md:flex md:flex-row md:space-x-6 md:space-y-0"></main>
</section>
</div>
{/* TODO fix ça c'est pas responsive */}
{/* <section className="flex-col space-y-4">
<header>
<h3 className="text-xl font-semibold">Statistiques</h3>
<p className="text-muted">Ceci est la page d&apos;accueil du dashboard</p>
</header>
<main className="flex-col justify-between space-x-0 space-y-4 sm:flex sm:flex-row sm:space-x-4 sm:space-y-0">
<main className="flex-col justify-between space-x-0 space-y-4 sm:flex sm:flex-row sm:space-x-6 sm:space-y-0">
<CardTable
puzzles={[
{ name: 'Jour 0 | Save Conway Gadgetski', id: '1', content: '' },
{ name: 'Jour 1 | Next', id: '2', content: '' },
{ name: 'Jour 0 | Save Conway Gadgetski', id: 1', content: '' },
{ name: 'Jour 1 | Next', id: 2', content: '' },
{ name: 'Jour 2 | Previous', id: '3', content: '' },
{ name: 'Jour 3 | Next 1 loop', id: '4', content: '' },
{ name: 'Jour 4 | Next no loop + recursion', id: '5', content: '' },

View file

@ -1,16 +1,21 @@
import { getPuzzle, getPuzzles } from '@/lib/puzzles';
import Puzzle from '@/ui/Puzzle';
import { notFound } from 'next/navigation';
export default async function Page({ params }: { params: { id: number } }) {
const { id } = params;
return (
// <SWRFallback fallback={{ [`puzzles/${id}`]: puzzle }}>
<Puzzle id={id} />
// </SWRFallback>
);
const puzzle = await getPuzzle(id);
if (!puzzle) {
notFound();
}
return <Puzzle puzzle={puzzle} />;
}
// export async function generateStaticParams() {
// const { puzzles } = await getPuzzles();
// return puzzles.map(({ id }) => ({ params: { id } }));
// }
export async function generateStaticParams() {
const { puzzles } = await getPuzzles();
// every id is a number, but we need to return a string
return puzzles.map((puzzle) => ({ id: puzzle.id.toString() }));
}

View file

@ -1,13 +1,12 @@
import { getPuzzles } from '@/lib/puzzles';
import Puzzles from '@/ui/Puzzles';
export default async function Page() {
// const puzzles = await getPuzzles();
const data = await getPuzzles();
return (
<div className="flex flex-col space-y-6">
{/* <SWRFallback fallback={{ ['puzzles']: puzzles }}> */}
<Puzzles />
{/* </SWRFallback> */}
<Puzzles data={data} />
</div>
);
}

View file

@ -1,4 +1,5 @@
import useSWR from 'swr';
import { getChapters, getPuzzle, getPuzzles } from '../puzzles';
export function useChapters() {

View file

@ -1,9 +1,13 @@
import axios from 'axios';
export const getChapters = async (): Promise<Chapter[]> => {
const req = await fetch(`http://170.75.166.204/chapters`);
const { data, status } = await axios.get(`${process.env.NEXT_PUBLIC_API_URL}/chapters`, {
insecureHTTPParser: true
});
let chapters = await req.json();
let chapters = data;
if (!req.ok) {
if (status !== 200) {
throw new Error('Failed to fetch puzzles');
}
@ -19,11 +23,14 @@ export const getChapters = async (): Promise<Chapter[]> => {
};
export const getPuzzlesByChapter = async (chapitre: number): Promise<Chapter | null> => {
const req = await fetch(`http://170.75.166.204/chapter/${chapitre}`);
const { data, status } = await axios.get(
`${process.env.NEXT_PUBLIC_API_URL}/chapter/${chapitre}`,
{ insecureHTTPParser: true }
);
const { puzzles, name, id } = await req.json();
const { puzzles, name, id } = data;
if (!req.ok) {
if (status !== 200) {
throw new Error('Failed to fetch puzzles');
}
@ -54,11 +61,13 @@ export const getPuzzles = async (): Promise<{ chapters: Chapter[]; puzzles: Puzz
};
export const getPuzzle = async (id: number): Promise<Puzzle> => {
const req = await fetch(`http://170.75.166.204/puzzle/${id}`);
const { data, status } = await axios.get(`${process.env.NEXT_PUBLIC_API_URL}/puzzle/${id}`, {
insecureHTTPParser: true
});
const puzzle = await req.json();
const puzzle = data;
if (!req.ok) {
if (status !== 200) {
throw new Error('Failed to fetch puzzle');
}

View file

@ -12,3 +12,17 @@ import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
/**
* Permet de convertir une chaîne de caractères en majuscules.
*
* @param string - La chaîne de caractères à convertir.
* @returns La chaîne de caractères convertie.
*/
export function titleCase(string: string) {
return string
.toLowerCase()
.split(' ')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
}

View file

@ -1,18 +1,19 @@
import { NextResponse } from 'next/server';
import { type NextRequest, NextResponse } from 'next/server';
/**
* Permet de créer un middleware Next.js qui sera exécuté avant chaque requête.
*
* @param request - La requête.
* @param req - La requête.
*/
export async function middleware() {
const response = NextResponse.next();
return response;
export async function middleware(req: NextRequest) {
const res = NextResponse.next();
console.log('Res', res);
return res;
}
export const config = {
matcher: [
// On exclut les routes de l'API, les fichiers statiques, les images, les assets, le favicon et le service worker.
'/((?!api|_next/static|_next/image|assets|favicon|sw.js).*)'
// '/((?!api|_next/static|_next/image|assets|favicon|sw.js).*)'
]
};

View file

@ -22,6 +22,7 @@
"homepage": "https://github.com/Peer-at-Code/peer-at-code#readme",
"dependencies": {
"@next/font": "13.1.6",
"axios": "^1.3.4",
"clsx": "^1.2.1",
"next": "13.1.6",
"react": "18.2.0",

312
pnpm-lock.yaml generated
View file

@ -9,6 +9,7 @@ specifiers:
'@typescript-eslint/eslint-plugin': ^5.50.0
'@typescript-eslint/parser': ^5.50.0
autoprefixer: ^10.4.13
axios: ^1.3.4
clsx: ^1.2.1
eslint: 8.33.0
eslint-config-next: 13.1.6
@ -31,39 +32,40 @@ specifiers:
dependencies:
'@next/font': 13.1.6
axios: 1.3.4
clsx: 1.2.1
next: 13.1.6_biqbaboplfbrettd7655fr4n2y
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
react-hook-form: 7.43.1_react@18.2.0
react-hook-form: 7.43.2_react@18.2.0
react-markdown: 8.0.5_3stiutgnnbnfnf3uowm5cip22i
remixicon: 2.5.0
swr: 2.0.3_react@18.2.0
tailwind-merge: 1.9.0
zod: 3.20.2
tailwind-merge: 1.10.0
zod: 3.20.6
devDependencies:
'@tailwindcss/forms': 0.5.3_tailwindcss@3.2.4
'@tailwindcss/forms': 0.5.3_tailwindcss@3.2.7
'@types/node': 18.11.18
'@types/react': 18.0.27
'@types/react-dom': 18.0.10
'@typescript-eslint/eslint-plugin': 5.50.0_go4drrxstycfikanvu45pi4vgq
'@typescript-eslint/parser': 5.50.0_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/eslint-plugin': 5.53.0_ykh43m6bol72tlxwoakwn2eb7a
'@typescript-eslint/parser': 5.53.0_4vsywjlpuriuw3tl5oq6zy5a64
autoprefixer: 10.4.13_postcss@8.4.21
eslint: 8.33.0
eslint-config-next: 13.1.6_4vsywjlpuriuw3tl5oq6zy5a64
eslint-config-prettier: 8.6.0_eslint@8.33.0
eslint-plugin-prettier: 4.2.1_jqplj6qf3uqpxpu4gdyhwwasnq
eslint-plugin-prettier: 4.2.1_qa2thblfovmfepmgrc7z2owbo4
postcss: 8.4.21
prettier: 2.8.3
prettier-plugin-tailwindcss: 0.2.2_prettier@2.8.3
tailwindcss: 3.2.4_postcss@8.4.21
prettier: 2.8.4
prettier-plugin-tailwindcss: 0.2.3_prettier@2.8.4
tailwindcss: 3.2.7_postcss@8.4.21
typescript: 4.9.5
packages:
/@babel/runtime/7.20.13:
resolution: {integrity: sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA==}
/@babel/runtime/7.21.0:
resolution: {integrity: sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==}
engines: {node: '>=6.9.0'}
dependencies:
regenerator-runtime: 0.13.11
@ -264,7 +266,7 @@ packages:
dependencies:
cross-spawn: 7.0.3
is-glob: 4.0.3
open: 8.4.0
open: 8.4.2
picocolors: 1.0.0
tiny-glob: 0.2.9
tslib: 2.5.0
@ -280,13 +282,13 @@ packages:
tslib: 2.5.0
dev: false
/@tailwindcss/forms/0.5.3_tailwindcss@3.2.4:
/@tailwindcss/forms/0.5.3_tailwindcss@3.2.7:
resolution: {integrity: sha512-y5mb86JUoiUgBjY/o6FJSFZSEttfb3Q5gllE4xoKjAAD+vBrnIhE4dViwUuow3va8mpH4s9jyUbUbrRGoRdc2Q==}
peerDependencies:
tailwindcss: '>=3.0.0 || >= 3.0.0-alpha.1'
dependencies:
mini-svg-data-uri: 1.4.4
tailwindcss: 3.2.4_postcss@8.4.21
tailwindcss: 3.2.7_postcss@8.4.21
dev: true
/@types/debug/4.1.7:
@ -350,8 +352,8 @@ packages:
resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==}
dev: false
/@typescript-eslint/eslint-plugin/5.50.0_go4drrxstycfikanvu45pi4vgq:
resolution: {integrity: sha512-vwksQWSFZiUhgq3Kv7o1Jcj0DUNylwnIlGvKvLLYsq8pAWha6/WCnXUeaSoNNha/K7QSf2+jvmkxggC1u3pIwQ==}
/@typescript-eslint/eslint-plugin/5.53.0_ykh43m6bol72tlxwoakwn2eb7a:
resolution: {integrity: sha512-alFpFWNucPLdUOySmXCJpzr6HKC3bu7XooShWM+3w/EL6J2HIoB2PFxpLnq4JauWVk6DiVeNKzQlFEaE+X9sGw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
'@typescript-eslint/parser': ^5.0.0
@ -361,10 +363,10 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/parser': 5.50.0_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/scope-manager': 5.50.0
'@typescript-eslint/type-utils': 5.50.0_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/utils': 5.50.0_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/parser': 5.53.0_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/scope-manager': 5.53.0
'@typescript-eslint/type-utils': 5.53.0_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/utils': 5.53.0_4vsywjlpuriuw3tl5oq6zy5a64
debug: 4.3.4
eslint: 8.33.0
grapheme-splitter: 1.0.4
@ -378,8 +380,8 @@ packages:
- supports-color
dev: true
/@typescript-eslint/parser/5.50.0_4vsywjlpuriuw3tl5oq6zy5a64:
resolution: {integrity: sha512-KCcSyNaogUDftK2G9RXfQyOCt51uB5yqC6pkUYqhYh8Kgt+DwR5M0EwEAxGPy/+DH6hnmKeGsNhiZRQxjH71uQ==}
/@typescript-eslint/parser/5.53.0_4vsywjlpuriuw3tl5oq6zy5a64:
resolution: {integrity: sha512-MKBw9i0DLYlmdOb3Oq/526+al20AJZpANdT6Ct9ffxcV8nKCHz63t/S0IhlTFNsBIHJv+GY5SFJ0XfqVeydQrQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
@ -388,9 +390,9 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/scope-manager': 5.50.0
'@typescript-eslint/types': 5.50.0
'@typescript-eslint/typescript-estree': 5.50.0_typescript@4.9.5
'@typescript-eslint/scope-manager': 5.53.0
'@typescript-eslint/types': 5.53.0
'@typescript-eslint/typescript-estree': 5.53.0_typescript@4.9.5
debug: 4.3.4
eslint: 8.33.0
typescript: 4.9.5
@ -398,16 +400,16 @@ packages:
- supports-color
dev: true
/@typescript-eslint/scope-manager/5.50.0:
resolution: {integrity: sha512-rt03kaX+iZrhssaT974BCmoUikYtZI24Vp/kwTSy841XhiYShlqoshRFDvN1FKKvU2S3gK+kcBW1EA7kNUrogg==}
/@typescript-eslint/scope-manager/5.53.0:
resolution: {integrity: sha512-Opy3dqNsp/9kBBeCPhkCNR7fmdSQqA+47r21hr9a14Bx0xnkElEQmhoHga+VoaoQ6uDHjDKmQPIYcUcKJifS7w==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
'@typescript-eslint/types': 5.50.0
'@typescript-eslint/visitor-keys': 5.50.0
'@typescript-eslint/types': 5.53.0
'@typescript-eslint/visitor-keys': 5.53.0
dev: true
/@typescript-eslint/type-utils/5.50.0_4vsywjlpuriuw3tl5oq6zy5a64:
resolution: {integrity: sha512-dcnXfZ6OGrNCO7E5UY/i0ktHb7Yx1fV6fnQGGrlnfDhilcs6n19eIRcvLBqx6OQkrPaFlDPk3OJ0WlzQfrV0bQ==}
/@typescript-eslint/type-utils/5.53.0_4vsywjlpuriuw3tl5oq6zy5a64:
resolution: {integrity: sha512-HO2hh0fmtqNLzTAme/KnND5uFNwbsdYhCZghK2SoxGp3Ifn2emv+hi0PBUjzzSh0dstUIFqOj3bp0AwQlK4OWw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: '*'
@ -416,8 +418,8 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/typescript-estree': 5.50.0_typescript@4.9.5
'@typescript-eslint/utils': 5.50.0_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/typescript-estree': 5.53.0_typescript@4.9.5
'@typescript-eslint/utils': 5.53.0_4vsywjlpuriuw3tl5oq6zy5a64
debug: 4.3.4
eslint: 8.33.0
tsutils: 3.21.0_typescript@4.9.5
@ -426,13 +428,13 @@ packages:
- supports-color
dev: true
/@typescript-eslint/types/5.50.0:
resolution: {integrity: sha512-atruOuJpir4OtyNdKahiHZobPKFvZnBnfDiyEaBf6d9vy9visE7gDjlmhl+y29uxZ2ZDgvXijcungGFjGGex7w==}
/@typescript-eslint/types/5.53.0:
resolution: {integrity: sha512-5kcDL9ZUIP756K6+QOAfPkigJmCPHcLN7Zjdz76lQWWDdzfOhZDTj1irs6gPBKiXx5/6O3L0+AvupAut3z7D2A==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dev: true
/@typescript-eslint/typescript-estree/5.50.0_typescript@4.9.5:
resolution: {integrity: sha512-Gq4zapso+OtIZlv8YNAStFtT6d05zyVCK7Fx3h5inlLBx2hWuc/0465C2mg/EQDDU2LKe52+/jN4f0g9bd+kow==}
/@typescript-eslint/typescript-estree/5.53.0_typescript@4.9.5:
resolution: {integrity: sha512-eKmipH7QyScpHSkhbptBBYh9v8FxtngLquq292YTEQ1pxVs39yFBlLC1xeIZcPPz1RWGqb7YgERJRGkjw8ZV7w==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
typescript: '*'
@ -440,8 +442,8 @@ packages:
typescript:
optional: true
dependencies:
'@typescript-eslint/types': 5.50.0
'@typescript-eslint/visitor-keys': 5.50.0
'@typescript-eslint/types': 5.53.0
'@typescript-eslint/visitor-keys': 5.53.0
debug: 4.3.4
globby: 11.1.0
is-glob: 4.0.3
@ -452,17 +454,17 @@ packages:
- supports-color
dev: true
/@typescript-eslint/utils/5.50.0_4vsywjlpuriuw3tl5oq6zy5a64:
resolution: {integrity: sha512-v/AnUFImmh8G4PH0NDkf6wA8hujNNcrwtecqW4vtQ1UOSNBaZl49zP1SHoZ/06e+UiwzHpgb5zP5+hwlYYWYAw==}
/@typescript-eslint/utils/5.53.0_4vsywjlpuriuw3tl5oq6zy5a64:
resolution: {integrity: sha512-VUOOtPv27UNWLxFwQK/8+7kvxVC+hPHNsJjzlJyotlaHjLSIgOCKj9I0DBUjwOOA64qjBwx5afAPjksqOxMO0g==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
'@types/json-schema': 7.0.11
'@types/semver': 7.3.13
'@typescript-eslint/scope-manager': 5.50.0
'@typescript-eslint/types': 5.50.0
'@typescript-eslint/typescript-estree': 5.50.0_typescript@4.9.5
'@typescript-eslint/scope-manager': 5.53.0
'@typescript-eslint/types': 5.53.0
'@typescript-eslint/typescript-estree': 5.53.0_typescript@4.9.5
eslint: 8.33.0
eslint-scope: 5.1.1
eslint-utils: 3.0.0_eslint@8.33.0
@ -472,11 +474,11 @@ packages:
- typescript
dev: true
/@typescript-eslint/visitor-keys/5.50.0:
resolution: {integrity: sha512-cdMeD9HGu6EXIeGOh2yVW6oGf9wq8asBgZx7nsR/D36gTfQ0odE5kcRYe5M81vjEFAcPeugXrHg78Imu55F6gg==}
/@typescript-eslint/visitor-keys/5.53.0:
resolution: {integrity: sha512-JqNLnX3leaHFZEN0gCh81sIvgrp/2GOACZNgO4+Tkf64u51kTpAyWFOY8XHx8XuXr3N2C9zgPPHtcpMg6z1g0w==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
dependencies:
'@typescript-eslint/types': 5.50.0
'@typescript-eslint/types': 5.53.0
eslint-visitor-keys: 3.3.0
dev: true
@ -561,7 +563,7 @@ packages:
engines: {node: '>= 0.4'}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
get-intrinsic: 1.2.0
is-string: 1.0.7
@ -577,7 +579,7 @@ packages:
engines: {node: '>= 0.4'}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
es-shim-unscopables: 1.0.0
dev: true
@ -587,7 +589,7 @@ packages:
engines: {node: '>= 0.4'}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
es-shim-unscopables: 1.0.0
dev: true
@ -596,7 +598,7 @@ packages:
resolution: {integrity: sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
es-shim-unscopables: 1.0.0
get-intrinsic: 1.2.0
@ -606,6 +608,10 @@ packages:
resolution: {integrity: sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==}
dev: true
/asynckit/0.4.0:
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
dev: false
/autoprefixer/10.4.13_postcss@8.4.21:
resolution: {integrity: sha512-49vKpMqcZYsJjwotvt4+h/BCjJVnhGwcLpDt5xkcaOG3eLrG/HUYLagrihYsQ+qrIBgIzX1Rw7a6L8I/ZA1Atg==}
engines: {node: ^10 || ^12 || >=14}
@ -614,7 +620,7 @@ packages:
postcss: ^8.1.0
dependencies:
browserslist: 4.21.5
caniuse-lite: 1.0.30001450
caniuse-lite: 1.0.30001457
fraction.js: 4.2.0
normalize-range: 0.1.2
picocolors: 1.0.0
@ -632,6 +638,16 @@ packages:
engines: {node: '>=4'}
dev: true
/axios/1.3.4:
resolution: {integrity: sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==}
dependencies:
follow-redirects: 1.15.2
form-data: 4.0.0
proxy-from-env: 1.1.0
transitivePeerDependencies:
- debug
dev: false
/axobject-query/3.1.1:
resolution: {integrity: sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==}
dependencies:
@ -670,9 +686,9 @@ packages:
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
dependencies:
caniuse-lite: 1.0.30001450
electron-to-chromium: 1.4.286
node-releases: 2.0.9
caniuse-lite: 1.0.30001457
electron-to-chromium: 1.4.306
node-releases: 2.0.10
update-browserslist-db: 1.0.10_browserslist@4.21.5
dev: true
@ -693,8 +709,8 @@ packages:
engines: {node: '>= 6'}
dev: true
/caniuse-lite/1.0.30001450:
resolution: {integrity: sha512-qMBmvmQmFXaSxexkjjfMvD5rnDL0+m+dUMZKoDYsGG8iZN29RuYh9eRoMvKsT6uMAWlyUUGDEQGJJYjzCIO9ew==}
/caniuse-lite/1.0.30001457:
resolution: {integrity: sha512-SDIV6bgE1aVbK6XyxdURbUE89zY7+k1BBBaOwYwkNCglXlel/E7mELiHC64HQ+W0xSKlqWhV9Wh7iHxUjMs4fA==}
/chalk/4.1.2:
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
@ -743,6 +759,13 @@ packages:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
dev: true
/combined-stream/1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
dependencies:
delayed-stream: 1.0.0
dev: false
/comma-separated-tokens/2.0.3:
resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==}
dev: false
@ -832,8 +855,8 @@ packages:
engines: {node: '>=8'}
dev: true
/define-properties/1.1.4:
resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==}
/define-properties/1.2.0:
resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==}
engines: {node: '>= 0.4'}
dependencies:
has-property-descriptors: 1.0.0
@ -844,6 +867,11 @@ packages:
resolution: {integrity: sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==}
dev: true
/delayed-stream/1.0.0:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
dev: false
/dequal/2.0.3:
resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
engines: {node: '>=6'}
@ -856,7 +884,7 @@ packages:
dependencies:
acorn-node: 1.8.2
defined: 1.0.1
minimist: 1.2.7
minimist: 1.2.8
dev: true
/didyoumean/1.2.2:
@ -893,8 +921,8 @@ packages:
esutils: 2.0.3
dev: true
/electron-to-chromium/1.4.286:
resolution: {integrity: sha512-Vp3CVhmYpgf4iXNKAucoQUDcCrBQX3XLBtwgFqP9BUXuucgvAV9zWp1kYU7LL9j4++s9O+12cb3wMtN4SJy6UQ==}
/electron-to-chromium/1.4.306:
resolution: {integrity: sha512-1zGmLFfpcs2v7ELt/1HgLZF6Gm2CCHaAdNKxd9Ge4INSU/HDYWjs7fcWU6eVMmhkpwmh+52ZrGCUU+Ji9OJihA==}
dev: true
/emoji-regex/9.2.2:
@ -927,7 +955,7 @@ packages:
has-property-descriptors: 1.0.0
has-proto: 1.0.1
has-symbols: 1.0.3
internal-slot: 1.0.4
internal-slot: 1.0.5
is-array-buffer: 3.0.1
is-callable: 1.2.7
is-negative-zero: 2.0.2
@ -1007,11 +1035,11 @@ packages:
dependencies:
'@next/eslint-plugin-next': 13.1.6
'@rushstack/eslint-patch': 1.2.0
'@typescript-eslint/parser': 5.50.0_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/parser': 5.53.0_4vsywjlpuriuw3tl5oq6zy5a64
eslint: 8.33.0
eslint-import-resolver-node: 0.3.7
eslint-import-resolver-typescript: 3.5.3_ohdts44xlqyeyrlje4qnefqeay
eslint-plugin-import: 2.27.5_nowqz4jutkd4a233czbfk7jsgu
eslint-plugin-import: 2.27.5_ihi7zonu3qx6j4e6z5amj224zy
eslint-plugin-jsx-a11y: 6.7.1_eslint@8.33.0
eslint-plugin-react: 7.32.2_eslint@8.33.0
eslint-plugin-react-hooks: 4.6.0_eslint@8.33.0
@ -1050,8 +1078,8 @@ packages:
debug: 4.3.4
enhanced-resolve: 5.12.0
eslint: 8.33.0
eslint-plugin-import: 2.27.5_nowqz4jutkd4a233czbfk7jsgu
get-tsconfig: 4.3.0
eslint-plugin-import: 2.27.5_ihi7zonu3qx6j4e6z5amj224zy
get-tsconfig: 4.4.0
globby: 13.1.3
is-core-module: 2.11.0
is-glob: 4.0.3
@ -1060,7 +1088,7 @@ packages:
- supports-color
dev: true
/eslint-module-utils/2.7.4_4lq3tljpmtdh3elqaianviuctu:
/eslint-module-utils/2.7.4_g6ihnuafz6a5ascp3mdeb6bodi:
resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==}
engines: {node: '>=4'}
peerDependencies:
@ -1081,7 +1109,7 @@ packages:
eslint-import-resolver-webpack:
optional: true
dependencies:
'@typescript-eslint/parser': 5.50.0_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/parser': 5.53.0_4vsywjlpuriuw3tl5oq6zy5a64
debug: 3.2.7
eslint: 8.33.0
eslint-import-resolver-node: 0.3.7
@ -1090,7 +1118,7 @@ packages:
- supports-color
dev: true
/eslint-plugin-import/2.27.5_nowqz4jutkd4a233czbfk7jsgu:
/eslint-plugin-import/2.27.5_ihi7zonu3qx6j4e6z5amj224zy:
resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==}
engines: {node: '>=4'}
peerDependencies:
@ -1100,7 +1128,7 @@ packages:
'@typescript-eslint/parser':
optional: true
dependencies:
'@typescript-eslint/parser': 5.50.0_4vsywjlpuriuw3tl5oq6zy5a64
'@typescript-eslint/parser': 5.53.0_4vsywjlpuriuw3tl5oq6zy5a64
array-includes: 3.1.6
array.prototype.flat: 1.3.1
array.prototype.flatmap: 1.3.1
@ -1108,7 +1136,7 @@ packages:
doctrine: 2.1.0
eslint: 8.33.0
eslint-import-resolver-node: 0.3.7
eslint-module-utils: 2.7.4_4lq3tljpmtdh3elqaianviuctu
eslint-module-utils: 2.7.4_g6ihnuafz6a5ascp3mdeb6bodi
has: 1.0.3
is-core-module: 2.11.0
is-glob: 4.0.3
@ -1129,7 +1157,7 @@ packages:
peerDependencies:
eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8
dependencies:
'@babel/runtime': 7.20.13
'@babel/runtime': 7.21.0
aria-query: 5.1.3
array-includes: 3.1.6
array.prototype.flatmap: 1.3.1
@ -1148,7 +1176,7 @@ packages:
semver: 6.3.0
dev: true
/eslint-plugin-prettier/4.2.1_jqplj6qf3uqpxpu4gdyhwwasnq:
/eslint-plugin-prettier/4.2.1_qa2thblfovmfepmgrc7z2owbo4:
resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==}
engines: {node: '>=12.0.0'}
peerDependencies:
@ -1161,7 +1189,7 @@ packages:
dependencies:
eslint: 8.33.0
eslint-config-prettier: 8.6.0_eslint@8.33.0
prettier: 2.8.3
prettier: 2.8.4
prettier-linter-helpers: 1.0.0
dev: true
@ -1253,7 +1281,7 @@ packages:
eslint-utils: 3.0.0_eslint@8.33.0
eslint-visitor-keys: 3.3.0
espree: 9.4.1
esquery: 1.4.0
esquery: 1.4.2
esutils: 2.0.3
fast-deep-equal: 3.1.3
file-entry-cache: 6.0.1
@ -1291,8 +1319,8 @@ packages:
eslint-visitor-keys: 3.3.0
dev: true
/esquery/1.4.0:
resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==}
/esquery/1.4.2:
resolution: {integrity: sha512-JVSoLdTlTDkmjFmab7H/9SL9qGSyjElT3myyKp7krqjVFQCDLmj1QFaCLRFBszBKI0XVZaiiXvuPIX3ZwHe1Ng==}
engines: {node: '>=0.10'}
dependencies:
estraverse: 5.3.0
@ -1391,12 +1419,31 @@ packages:
resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==}
dev: true
/follow-redirects/1.15.2:
resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==}
engines: {node: '>=4.0'}
peerDependencies:
debug: '*'
peerDependenciesMeta:
debug:
optional: true
dev: false
/for-each/0.3.3:
resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
dependencies:
is-callable: 1.2.7
dev: true
/form-data/4.0.0:
resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
engines: {node: '>= 6'}
dependencies:
asynckit: 0.4.0
combined-stream: 1.0.8
mime-types: 2.1.35
dev: false
/fraction.js/4.2.0:
resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==}
dev: true
@ -1422,7 +1469,7 @@ packages:
engines: {node: '>= 0.4'}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
functions-have-names: 1.2.3
dev: true
@ -1447,8 +1494,8 @@ packages:
get-intrinsic: 1.2.0
dev: true
/get-tsconfig/4.3.0:
resolution: {integrity: sha512-YCcF28IqSay3fqpIu5y3Krg/utCBHBeoflkZyHj/QcqI2nrLPC3ZegS9CmIo+hJb8K7aiGsuUl7PwWVjNG2HQQ==}
/get-tsconfig/4.4.0:
resolution: {integrity: sha512-0Gdjo/9+FzsYhXCEFueo2aY1z1tpXrxWZzP7k8ul9qt1U5o8rYJwTJYmaeHdrVosYIVYkOy2iwCJ9FdpocJhPQ==}
dev: true
/glob-parent/5.1.2:
@ -1498,7 +1545,7 @@ packages:
resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==}
engines: {node: '>= 0.4'}
dependencies:
define-properties: 1.1.4
define-properties: 1.2.0
dev: true
/globalyzer/0.1.0:
@ -1622,8 +1669,8 @@ packages:
resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==}
dev: false
/internal-slot/1.0.4:
resolution: {integrity: sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ==}
/internal-slot/1.0.5:
resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==}
engines: {node: '>= 0.4'}
dependencies:
get-intrinsic: 1.2.0
@ -1841,7 +1888,7 @@ packages:
resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==}
hasBin: true
dependencies:
minimist: 1.2.7
minimist: 1.2.8
dev: true
/jsx-ast-utils/3.3.3:
@ -2139,6 +2186,18 @@ packages:
picomatch: 2.3.1
dev: true
/mime-db/1.52.0:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
dev: false
/mime-types/2.1.35:
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'}
dependencies:
mime-db: 1.52.0
dev: false
/mini-svg-data-uri/1.4.4:
resolution: {integrity: sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==}
hasBin: true
@ -2150,8 +2209,8 @@ packages:
brace-expansion: 1.1.11
dev: true
/minimist/1.2.7:
resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==}
/minimist/1.2.8:
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
dev: true
/mri/1.2.0:
@ -2199,7 +2258,7 @@ packages:
dependencies:
'@next/env': 13.1.6
'@swc/helpers': 0.4.14
caniuse-lite: 1.0.30001450
caniuse-lite: 1.0.30001457
postcss: 8.4.14
react: 18.2.0
react-dom: 18.2.0_react@18.2.0
@ -2223,8 +2282,8 @@ packages:
- babel-plugin-macros
dev: false
/node-releases/2.0.9:
resolution: {integrity: sha512-2xfmOrRkGogbTK9R6Leda0DGiXeY3p2NJpy4+gNCffdUvV6mdEJnaDEic1i3Ec2djAo8jWYoJMR5PB0MSMpxUA==}
/node-releases/2.0.10:
resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==}
dev: true
/normalize-path/3.0.0:
@ -2255,7 +2314,7 @@ packages:
engines: {node: '>= 0.4'}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
dev: true
/object-keys/1.1.1:
@ -2268,7 +2327,7 @@ packages:
engines: {node: '>= 0.4'}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
has-symbols: 1.0.3
object-keys: 1.1.1
dev: true
@ -2278,7 +2337,7 @@ packages:
engines: {node: '>= 0.4'}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
dev: true
@ -2287,14 +2346,14 @@ packages:
engines: {node: '>= 0.4'}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
dev: true
/object.hasown/1.1.2:
resolution: {integrity: sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==}
dependencies:
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
dev: true
@ -2303,7 +2362,7 @@ packages:
engines: {node: '>= 0.4'}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
dev: true
@ -2313,8 +2372,8 @@ packages:
wrappy: 1.0.2
dev: true
/open/8.4.0:
resolution: {integrity: sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==}
/open/8.4.2:
resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==}
engines: {node: '>=12'}
dependencies:
define-lazy-prop: 2.0.0
@ -2404,11 +2463,11 @@ packages:
resolve: 1.22.1
dev: true
/postcss-js/4.0.0_postcss@8.4.21:
resolution: {integrity: sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ==}
/postcss-js/4.0.1_postcss@8.4.21:
resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==}
engines: {node: ^12 || ^14 || >= 16}
peerDependencies:
postcss: ^8.3.3
postcss: ^8.4.21
dependencies:
camelcase-css: 2.0.1
postcss: 8.4.21
@ -2483,10 +2542,11 @@ packages:
fast-diff: 1.2.0
dev: true
/prettier-plugin-tailwindcss/0.2.2_prettier@2.8.3:
resolution: {integrity: sha512-5RjUbWRe305pUpc48MosoIp6uxZvZxrM6GyOgsbGLTce+ehePKNm7ziW2dLG2air9aXbGuXlHVSQQw4Lbosq3w==}
/prettier-plugin-tailwindcss/0.2.3_prettier@2.8.4:
resolution: {integrity: sha512-s2N5Dh7Ao5KTV1mao5ZBnn8EKtUcDPJEkGViZIjI0Ij9TTI5zgTz4IHOxW33jOdjHKa8CSjM88scelUiC5TNRQ==}
engines: {node: '>=12.17.0'}
peerDependencies:
'@ianvs/prettier-plugin-sort-imports': '*'
'@prettier/plugin-php': '*'
'@prettier/plugin-pug': '*'
'@shopify/prettier-plugin-liquid': '*'
@ -2503,6 +2563,8 @@ packages:
prettier-plugin-svelte: '*'
prettier-plugin-twig-melody: '*'
peerDependenciesMeta:
'@ianvs/prettier-plugin-sort-imports':
optional: true
'@prettier/plugin-php':
optional: true
'@prettier/plugin-pug':
@ -2532,11 +2594,11 @@ packages:
prettier-plugin-twig-melody:
optional: true
dependencies:
prettier: 2.8.3
prettier: 2.8.4
dev: true
/prettier/2.8.3:
resolution: {integrity: sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==}
/prettier/2.8.4:
resolution: {integrity: sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==}
engines: {node: '>=10.13.0'}
hasBin: true
dev: true
@ -2552,6 +2614,10 @@ packages:
resolution: {integrity: sha512-kma4U7AFCTwpqq5twzC1YVIDXSqg6qQK6JN0smOw8fgRy1OkMi0CYSzFmsy6dnqSenamAtj0CyXMUJ1Mf6oROg==}
dev: false
/proxy-from-env/1.1.0:
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
dev: false
/punycode/2.3.0:
resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
engines: {node: '>=6'}
@ -2576,8 +2642,8 @@ packages:
scheduler: 0.23.0
dev: false
/react-hook-form/7.43.1_react@18.2.0:
resolution: {integrity: sha512-+s3+s8LLytRMriwwuSqeLStVjRXFGxgjjx2jED7Z+wz1J/88vpxieRQGvJVvzrzVxshZ0BRuocFERb779m2kNg==}
/react-hook-form/7.43.2_react@18.2.0:
resolution: {integrity: sha512-NvD3Oe2Y9hhqo2R4I4iJigDzSLpdMnzUpNMxlnzTbdiT7NT3BW0GxWCzEtwPudZMUPbZhNcSy1EcGAygyhDORg==}
engines: {node: '>=12.22.0'}
peerDependencies:
react: ^16.8.0 || ^17 || ^18
@ -2648,7 +2714,7 @@ packages:
engines: {node: '>= 0.4'}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
functions-have-names: 1.2.3
dev: true
@ -2797,18 +2863,18 @@ packages:
resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==}
engines: {node: '>= 0.4'}
dependencies:
internal-slot: 1.0.4
internal-slot: 1.0.5
dev: true
/string.prototype.matchall/4.0.8:
resolution: {integrity: sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
get-intrinsic: 1.2.0
has-symbols: 1.0.3
internal-slot: 1.0.4
internal-slot: 1.0.5
regexp.prototype.flags: 1.4.3
side-channel: 1.0.4
dev: true
@ -2817,7 +2883,7 @@ packages:
resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
dev: true
@ -2825,7 +2891,7 @@ packages:
resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==}
dependencies:
call-bind: 1.0.2
define-properties: 1.1.4
define-properties: 1.2.0
es-abstract: 1.21.1
dev: true
@ -2899,12 +2965,12 @@ packages:
tslib: 2.5.0
dev: true
/tailwind-merge/1.9.0:
resolution: {integrity: sha512-coziXxViLHbVtFvD1+jwSu+UmDJSFX4dhj9ZuqHCuhTzu9Wk5wMedAz5AVY3uUYw95TaO7NwgUS/dLGcWvtgqw==}
/tailwind-merge/1.10.0:
resolution: {integrity: sha512-WFnDXSS4kFTZwjKg5/oZSGzBRU/l+qcbv5NVTzLUQvJ9yovDAP05h0F2+ZFW0Lw9EcgRoc2AfURUdZvnEFrXKg==}
dev: false
/tailwindcss/3.2.4_postcss@8.4.21:
resolution: {integrity: sha512-AhwtHCKMtR71JgeYDaswmZXhPcW9iuI9Sp2LvZPo9upDZ7231ZJ7eA9RaURbhpXGVlrjX4cFNlB4ieTetEb7hQ==}
/tailwindcss/3.2.7_postcss@8.4.21:
resolution: {integrity: sha512-B6DLqJzc21x7wntlH/GsZwEXTBttVSl1FtCzC8WP4oBc/NKef7kaax5jeihkkCEWc831/5NDJ9gRNDK6NEioQQ==}
engines: {node: '>=12.13.0'}
hasBin: true
peerDependencies:
@ -2926,7 +2992,7 @@ packages:
picocolors: 1.0.0
postcss: 8.4.21
postcss-import: 14.1.0_postcss@8.4.21
postcss-js: 4.0.0_postcss@8.4.21
postcss-js: 4.0.1_postcss@8.4.21
postcss-load-config: 3.1.4_postcss@8.4.21
postcss-nested: 6.0.0_postcss@8.4.21
postcss-selector-parser: 6.0.11
@ -2973,7 +3039,7 @@ packages:
dependencies:
'@types/json5': 0.0.29
json5: 1.0.2
minimist: 1.2.7
minimist: 1.2.8
strip-bom: 3.0.0
dev: true
@ -3199,6 +3265,6 @@ packages:
engines: {node: '>=10'}
dev: true
/zod/3.20.2:
resolution: {integrity: sha512-1MzNQdAvO+54H+EaK5YpyEy0T+Ejo/7YLHS93G3RnYWh5gaotGHwGeN/ZO687qEDU2y4CdStQYXVHIgrUl5UVQ==}
/zod/3.20.6:
resolution: {integrity: sha512-oyu0m54SGCtzh6EClBVqDDlAYRz4jrVtKwQ7ZnsEmMI9HnzuZFj8QFwAY1M5uniIYACdGvv0PBWPF2kO0aNofA==}
dev: false

View file

@ -1,8 +1,13 @@
export default function Card({ title, data }: { title: string; data: string }) {
import Icon from './Icon';
export default function Card({ icon, title, data }: { icon: string; title: string; data: string }) {
return (
<div className="flex w-full flex-col rounded-lg border-2 border-highlight-primary bg-primary-700 p-4 shadow-md">
<h3 className="text-xl font-semibold">{title}</h3>
<p className="text-muted">{data}</p>
<div className="flex w-full items-center space-x-4 rounded-lg border-2 border-highlight-primary bg-primary-700 p-4 shadow-md">
<Icon name={icon} className="text-2xl text-muted" />
<div className="flex flex-col">
<h3 className="text-xl font-semibold">{title}</h3>
<p className="text-muted">{data}</p>
</div>
</div>
);
}

View file

@ -4,41 +4,42 @@ import AppLink from './AppLink';
export default function CardTable({ puzzles }: { puzzles: Puzzle[] }) {
return (
<div className="relative h-96 w-full overflow-scroll">
<table className="min-w-full table-auto rounded-lg border-2 border-highlight-primary bg-primary-700 text-left text-sm text-muted shadow-md">
<thead className="z-1 sticky -top-1 bg-primary-600 text-xs uppercase text-white ">
<tr>
<th className="px-6 py-3">Exercice</th>
<th className="px-6 py-3">Tentative</th>
<th className="px-6 py-3">Score</th>
<th className="px-6 py-3">Dernier essai</th>
<th className="px-6 py-3">
<span className="sr-only">Reprendre</span>
</th>
</tr>
</thead>
<tbody className="overflow-y-scroll">
{puzzles.length &&
puzzles.map((puzzle) => (
<tr key={puzzle.id} className="bg-primary-700 hover:bg-primary-800 ">
<th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
{puzzle.name}
</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/${puzzle.id}`}
className="font-medium text-brand hover:underline"
>
Reprendre
</AppLink>
</td>
</tr>
))}
</tbody>
</table>
</div>
<></>
// <div className="relative flex h-96 w-full overflow-scroll">
// <table className="w-full table-auto border-collapse rounded-lg border-2 border-highlight-primary bg-primary-700 text-left text-sm text-muted shadow-md">
// {/* <thead className="z-1 sticky -top-1 bg-primary-600 text-xs uppercase text-white ">
// <tr>
// <th className="px-6 py-3">Exercice</th>
// <th className="px-6 py-3">Tentative</th>
// <th className="px-6 py-3">Score</th>
// <th className="px-6 py-3">Dernier essai</th>
// <th className="px-6 py-3">
// <span className="sr-only">Reprendre</span>
// </th>
// </tr>
// </thead> */}
// <tbody className="overflow-scroll">
// {puzzles.length &&
// puzzles.map((puzzle) => (
// <tr key={puzzle.id} className="bg-primary-700 hover:bg-primary-800 ">
// <th scope="row" className="whitespace-nowrap px-6 py-4 font-medium text-white">
// {puzzle.name}
// </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/${puzzle.id}`}
// className="font-medium text-brand hover:underline"
// >
// Reprendre
// </AppLink>
// </td>
// </tr>
// ))}
// </tbody>
// </table>
// </div>
);
}

View file

@ -1,18 +1,18 @@
'use client';
import { usePuzzle } from '@/lib/hooks/use-puzzles';
import { Puzzle as PuzzleType } from '@/lib/puzzles';
import { notFound } from 'next/navigation';
import Button from './Button';
import Input from './Input';
import ToHTML from './ToHTML';
export default function Puzzle({ id }: { id: number }) {
const { data: puzzle, isLoading } = usePuzzle(id);
export default function Puzzle({ puzzle }: { puzzle: PuzzleType }) {
// const puzzle = getPuzzle(id);
if (isLoading) {
return <></>;
}
// if (isLoading) {
// return <></>;
// }
if (!puzzle) {
notFound();

View file

@ -1,39 +1,38 @@
'use client';
import { usePuzzles } from '@/lib/hooks/use-puzzles';
import { Chapter, Puzzle } from '@/lib/puzzles';
import AppLink from './AppLink';
import Icon from './Icon';
export default function Puzzles() {
const { data, isLoading } = usePuzzles();
export default function Puzzles({ data }: { data: { chapters: Chapter[]; puzzles: Puzzle[] } }) {
// const { data, isLoading } = usePuzzles();
return (
<>
{!isLoading &&
data?.chapters?.map((chapter) => (
<div key={chapter.id} className="flex flex-col space-y-4">
<div className="flex items-center justify-between">
<h3 className="text-2xl font-semibold">
Chapitre {chapter.id} - {chapter.name}
</h3>
<div className="h-1 w-1/4 bg-gray-200">
<div className="h-1 w-1/2 bg-brand" />
</div>
{data?.chapters?.map((chapter) => (
<div key={chapter.id} className="flex flex-col space-y-4">
<div className="flex items-center justify-between">
<h3 className="text-2xl font-semibold">
Chapitre {chapter.id} - {chapter.name}
</h3>
<div className="h-1 w-1/4 rounded-lg bg-gray-200">
<div className="h-1 w-1/2 rounded-lg bg-brand" />
</div>
<ul className="flex flex-col space-y-4">
{data?.puzzles.map((puzzle) => (
<AppLink key={puzzle.id} href={`/dashboard/puzzles/${puzzle.id}`}>
<li className="group flex justify-between rounded-md bg-primary-700 p-4 font-code hover:bg-primary-600">
<span className="font-semibold">{puzzle.name}</span>
<Icon
className="-translate-x-2 transform-gpu duration-300 group-hover:translate-x-0"
name="arrow-right-line"
/>
</li>
</AppLink>
))}
</ul>
</div>
))}
<ul className="flex flex-col space-y-4">
{data?.puzzles.map((puzzle) => (
<AppLink key={puzzle.id} href={`/dashboard/puzzles/${puzzle.id}`}>
<li className="group flex justify-between rounded-md bg-primary-700 p-4 font-code hover:bg-primary-600">
<span className="font-semibold">{puzzle.name}</span>
<Icon
className="-translate-x-2 transform-gpu duration-300 group-hover:translate-x-0"
name="arrow-right-line"
/>
</li>
</AppLink>
))}
</ul>
</div>
))}
</>
);
}

View file

@ -15,9 +15,14 @@ export default function UserAuthForm() {
}
type FormData = {
email?: string;
username: string;
password: string;
pseudo: string;
email: string;
passwd: string;
firstname: string;
lastname: string;
description: string;
sgroup: string;
avatar: string;
};
function AuthForm() {
@ -28,9 +33,14 @@ function AuthForm() {
setError
} = useForm<FormData>({
defaultValues: {
pseudo: '',
email: '',
username: '',
password: ''
passwd: '',
firstname: '',
lastname: '',
description: '',
sgroup: '',
avatar: ''
}
});
@ -39,59 +49,114 @@ function AuthForm() {
const isSignIn = pathname.includes('sign-in');
async function onSubmit(data: FormData) {
const res = await fetch(`http://170.75.166.204/${isSignIn ? 'login' : 'register'}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
...data
})
});
const response = await fetch(
`${process.env.NEXT_PUBLIC_API_URL}/${isSignIn ? 'login' : 'register'}`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
...data
})
}
);
if (res.status === 200) {
const status = response.status;
const json = await response.json();
console.log(json, status);
if (status === 200) {
router.push('/dashboard');
}
}
return (
<form className="flex flex-col justify-center space-y-4" onSubmit={handleSubmit(onSubmit)}>
<form
className="flex w-52 flex-col justify-center space-y-4 sm:w-72"
onSubmit={handleSubmit(onSubmit)}
>
{!isSignIn && (
<Input
label="Adresse e-mail"
type="email"
placeholder="Ex: peer-at@exemple.be"
required
error={
errors.email?.message
// &&
// (isSignIn ? (
// <>
// {translations.noAccountAssociated}{' '}
// <AppLink className="underline" href="/sign-up">
// {translations.signUpQuestion}
// </AppLink>
// </>
// ) : (
// errors.email.message
// ))
}
{...register('email')}
/>
<>
<Input
label="Adresse e-mail"
type="email"
placeholder="peer-at@exemple.be"
required
error={
errors.email?.message
// &&
// (isSignIn ? (
// <>
// {translations.noAccountAssociated}{' '}
// <AppLink className="underline" href="/sign-up">
// {translations.signUpQuestion}
// </AppLink>
// </>
// ) : (
// errors.email.message
// ))
}
{...register('email')}
/>
<Input
label="Nom"
type="lastname"
placeholder="Doe"
error={
errors.lastname?.message
// &&
// (isSignIn ? (
// <>
// {translations.noAccountAssociated}{' '}
// <AppLink className="underline" href="/sign-up">
// {translations.signUpQuestion}
// </AppLink>
// </>
// ) : (
// errors.email.message
// ))
}
{...register('lastname')}
/>
<Input
label="Prénom"
type="firstname"
placeholder="John"
error={
errors.firstname?.message
// &&
// (isSignIn ? (
// <>
// {translations.noAccountAssociated}{' '}
// <AppLink className="underline" href="/sign-up">
// {translations.signUpQuestion}
// </AppLink>
// </>
// ) : (
// errors.email.message
// ))
}
{...register('firstname')}
/>
</>
)}
<Input
label="Nom d'utilisateur"
type="text"
placeholder='Ex: "PeerAt"'
placeholder="PeerAt"
required
{...register('username', { required: true })}
error={errors.passwd?.message}
{...register('pseudo')}
/>
<Input
label="Mot de passe"
type="password"
placeholder='Ex: "MotDePasse123"'
placeholder="MotDePasse123"
required
{...register('password', { required: true })}
error={errors.passwd?.message}
{...register('passwd')}
/>
<Button type="submit" kind="brand">
{isSignIn ? 'Se connecter' : "S'inscrire"}

View file

@ -10,7 +10,7 @@ export default function Sidenav({ isOpen, toggle }: { isOpen: boolean; toggle: (
return (
<aside
className={cn(
'absolute z-10 h-screen w-28 border-r border-highlight-primary bg-gradient-to-b from-primary-800 to-primary-900 shadow-md transition-all duration-300 ease-in-out sm:relative sm:flex sm:flex-col md:w-60',
'absolute z-10 h-screen w-28 border-r border-highlight-primary bg-gradient-to-b from-primary-800 to-primary-900 shadow-md transition-all duration-300 ease-in-out sm:relative sm:flex sm:flex-col lg:w-60',
{
'bottom-0 -translate-x-full sm:translate-x-0': !isOpen,
'bottom-0 w-full sm:w-28': isOpen
@ -73,11 +73,11 @@ function NavItem({
return (
<AppLink
href={item.disabled ? '/dashboard' : `/dashboard/${item.slug}`}
className={cn('flex justify-center rounded-md px-3 py-3 text-sm md:justify-start', {
className={cn('flex justify-center rounded-md px-3 py-3 text-sm lg:justify-start', {
'text-muted hover:text-secondary': !isActive,
'bg-highlight-primary text-secondary': isActive,
'text-gray-600 hover:text-gray-600': item.disabled,
'justify-center md:justify-start': isOpen,
'justify-center lg:justify-start': isOpen,
'justify-start sm:justify-center': !isOpen
})}
onClick={onClick}
@ -86,7 +86,7 @@ function NavItem({
<div className="flex items-center space-x-2">
<Icon className="text-2xl" name={item.icon} />
<span
className={cn('hidden md:block', {
className={cn('hidden lg:block', {
'block sm:hidden': isOpen,
hidden: !isOpen
})}
@ -97,44 +97,3 @@ function NavItem({
</AppLink>
);
}
{
/* <aside
className={cn(
'fixed top-0 z-10 w-full bg-dark shadow-md transition-all duration-300 ease-in-out sm:block md:hidden'
)}
>
<div className="flex items-center justify-end px-4 py-4">
<div className="flex items-center space-x-4">
<button onClick={onClick} className="flex h-10 w-full items-center space-x-2">
<span className={cn('text-xl font-semibold')}>Peer-at-Code</span>
<Icon
className={cn(
'text-xl transition-transform duration-300 ease-in-out',
isOpen ? 'rotate-180' : 'rotate-0'
)}
name="arrow-up-s-line"
/>
</button>
</div>
</div>
<div
className={cn(
'flex h-screen transform flex-col duration-100',
isOpen ? 'block' : 'hidden'
)}
>
<ul
className={cn(
'relative flex flex-col space-y-4 px-8 transition-all duration-300 ease-in-out'
)}
>
{navItems.map((item) => (
<li className="relative" key={item.slug} onClick={onClick}>
<NavItem item={item} isOpen={isOpen} />
</li>
))}
</ul>
</div>
</aside> */
}

View file

@ -1,20 +1,11 @@
'use client';
import { titleCase } from '@/lib/utils';
import { useSelectedLayoutSegment } from 'next/navigation';
import Icon from '../Icon';
export default function Usernav({ isOpen, toggle }: { isOpen: boolean; toggle: () => void }) {
const segment = useSelectedLayoutSegment();
// segment to TitleCase
const titleCase = (str: string) => {
return str
.toLowerCase()
.split(' ')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
};
return (
<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">
@ -30,12 +21,12 @@ export default function Usernav({ isOpen, toggle }: { isOpen: boolean; toggle: (
)}
</div>
<div className="flex flex-row items-center space-x-4">
<div className="flex items-center justify-center p-1 text-xl">
<button className="flex items-center text-2xl text-error">
<Icon name="flag-line" />
</div>
<div className="flex items-center justify-center rounded-full bg-highlight-primary px-4 py-2">
</button>
<button className="flex items-center justify-center rounded-full border border-primary-400 bg-tertiary px-4 py-2">
T
</div>
</button>
</div>
</div>
);