From b1641adbfad6b06e2e5cefe6360ba2e53776ff3c Mon Sep 17 00:00:00 2001 From: alexandre-kakal <84040142+alexandre-kakal@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:02:00 +0200 Subject: [PATCH] Ak event form (#23) fix: authOptions callback init event form --------- Co-authored-by: alexandre-kakal-akarah Co-authored-by: GuillaumeD --- package-lock.json | 33 ++++ package.json | 1 + src/app/(app)/layout.tsx | 2 + src/app/(app)/parcours/[id]/page.tsx | 16 +- src/app/(app)/profil/page.tsx | 3 +- src/app/api/journeys/route.ts | 2 +- src/app/layout.tsx | 13 +- src/components/form/event/EventForm.tsx | 208 ++++++++++++++++++++ src/components/form/journey/JourneyForm.tsx | 17 +- src/components/ui/button.tsx | 43 +++- src/components/ui/slider.tsx | 28 +++ src/lib/authOptions.ts | 15 +- src/providers/Providers.tsx | 5 + src/store/eventFormStore.ts | 25 +++ src/types/enums/button.ts | 5 + src/validators/EventFormSchema.ts | 51 +++++ 16 files changed, 439 insertions(+), 28 deletions(-) create mode 100644 src/components/form/event/EventForm.tsx create mode 100644 src/components/ui/slider.tsx create mode 100644 src/store/eventFormStore.ts create mode 100644 src/types/enums/button.ts create mode 100644 src/validators/EventFormSchema.ts diff --git a/package-lock.json b/package-lock.json index e35e4c1..80475dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@radix-ui/react-popover": "^1.1.1", "@radix-ui/react-radio-group": "^1.2.0", "@radix-ui/react-select": "^2.1.1", + "@radix-ui/react-slider": "^1.2.0", "@radix-ui/react-slot": "^1.1.0", "bcrypt": "^5.1.1", "class-variance-authority": "^0.7.0", @@ -3419,6 +3420,38 @@ } } }, + "node_modules/@radix-ui/react-slider": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slider/-/react-slider-1.2.0.tgz", + "integrity": "sha512-dAHCDA4/ySXROEPaRtaMV5WHL8+JB/DbtyTbJjYkY0RXmKMO2Ln8DFZhywG5/mVQ4WqHDBc8smc14yPXPqZHYA==", + "dependencies": { + "@radix-ui/number": "1.1.0", + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-collection": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-context": "1.1.0", + "@radix-ui/react-direction": "1.1.0", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-use-controllable-state": "1.1.0", + "@radix-ui/react-use-layout-effect": "1.1.0", + "@radix-ui/react-use-previous": "1.1.0", + "@radix-ui/react-use-size": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.1.0.tgz", diff --git a/package.json b/package.json index ec5b298..c056c91 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@radix-ui/react-popover": "^1.1.1", "@radix-ui/react-radio-group": "^1.2.0", "@radix-ui/react-select": "^2.1.1", + "@radix-ui/react-slider": "^1.2.0", "@radix-ui/react-slot": "^1.1.0", "bcrypt": "^5.1.1", "class-variance-authority": "^0.7.0", diff --git a/src/app/(app)/layout.tsx b/src/app/(app)/layout.tsx index dc31b80..3657450 100644 --- a/src/app/(app)/layout.tsx +++ b/src/app/(app)/layout.tsx @@ -1,6 +1,7 @@ import React from "react"; import Nav from "@/components/Nav"; import { ReactParallaxProvider } from "@/providers/Providers"; +import EventForm from "@/components/form/event/EventForm"; export default function AppLayout({ children, @@ -10,6 +11,7 @@ export default function AppLayout({ return ( {children} +