diff --git a/app-old/.env b/app-old/.env deleted file mode 100644 index 153f9d9..0000000 --- a/app-old/.env +++ /dev/null @@ -1,7 +0,0 @@ -# Environment variables declared in this file are automatically made available to Prisma. -# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema - -# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB. -# See the documentation for all the connection string options: https://pris.ly/d/connection-strings - -DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public" \ No newline at end of file diff --git a/app-old/.prettierignore b/app-old/.prettierignore deleted file mode 100644 index a36da8f..0000000 --- a/app-old/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -data/**/*.md \ No newline at end of file diff --git a/app-old/.prettierrc b/app-old/.prettierrc deleted file mode 100644 index 963354f..0000000 --- a/app-old/.prettierrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "printWidth": 120 -} diff --git a/app-old/README.md b/app-old/README.md deleted file mode 100644 index 9dbe03c..0000000 --- a/app-old/README.md +++ /dev/null @@ -1,53 +0,0 @@ -Generated with [vike.dev/new](https://vike.dev/new) ([version 410](https://www.npmjs.com/package/create-vike/v/0.0.410)) using this command: - -```sh -pnpm create vike@latest --react --tailwindcss --telefunc --fastify --eslint --prettier -``` - -## Contents - -* [React](#react) - - * [`/pages/+config.ts`](#pagesconfigts) - * [Routing](#routing) - * [`/pages/_error/+Page.jsx`](#pages_errorpagejsx) - * [`/pages/+onPageTransitionStart.ts` and `/pages/+onPageTransitionEnd.ts`](#pagesonpagetransitionstartts-and-pagesonpagetransitionendts) - * [SSR](#ssr) - * [HTML Streaming](#html-streaming) - -## React - -This app is ready to start. It's powered by [Vike](https://vike.dev) and [React](https://react.dev/learn). - -### `/pages/+config.ts` - -Such `+` files are [the interface](https://vike.dev/config) between Vike and your code. It defines: - -* A default [`` component](https://vike.dev/Layout) (that wraps your [`` components](https://vike.dev/Page)). -* A default [`title`](https://vike.dev/title). -* Global [`` tags](https://vike.dev/head-tags). - -### Routing - -[Vike's built-in router](https://vike.dev/routing) lets you choose between: - -* [Filesystem Routing](https://vike.dev/filesystem-routing) (the URL of a page is determined based on where its `+Page.jsx` file is located on the filesystem) -* [Route Strings](https://vike.dev/route-string) -* [Route Functions](https://vike.dev/route-function) - -### `/pages/_error/+Page.jsx` - -The [error page](https://vike.dev/error-page) which is rendered when errors occur. - -### `/pages/+onPageTransitionStart.ts` and `/pages/+onPageTransitionEnd.ts` - -The [`onPageTransitionStart()` hook](https://vike.dev/onPageTransitionStart), together with [`onPageTransitionEnd()`](https://vike.dev/onPageTransitionEnd), enables you to implement page transition animations. - -### SSR - -SSR is enabled by default. You can [disable it](https://vike.dev/ssr) for all your pages or only for some pages. - -### HTML Streaming - -You can enable/disable [HTML streaming](https://vike.dev/stream) for all your pages, or only for some pages while still using it for others. - diff --git a/app-old/assets/logo.afdesign b/app-old/assets/logo.afdesign deleted file mode 100644 index 6345ef8..0000000 Binary files a/app-old/assets/logo.afdesign and /dev/null differ diff --git a/app-old/assets/logo.svg b/app-old/assets/logo.svg deleted file mode 100644 index 1c45366..0000000 --- a/app-old/assets/logo.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/app-old/components/common/Cookies.telefunc.ts b/app-old/components/common/Cookies.telefunc.ts deleted file mode 100644 index 723a2c2..0000000 --- a/app-old/components/common/Cookies.telefunc.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { PageContext } from "vike/types"; - -import { getTelefuncContext } from "@/lib/getTelefuncContext"; -import { CookieParser } from "@/services/CookieParser"; - -export type ConsentCookies = keyof PageContext["cookies"]["consent"]; - -export async function onUpdateConsentCookie(cookieName: ConsentCookies, cookieValue: boolean) { - const context = getTelefuncContext(); - const { reply } = context; - - CookieParser.set(reply, cookieName, cookieValue.toString(), 365); - - return { ok: true, message: "Updated consent cookie", cookieName, cookieValue }; -} - -export async function onSetAllConsentCookie(cookieValue: boolean) { - const context = getTelefuncContext(); - const { reply } = context; - - CookieParser.set(reply, "analytics", cookieValue.toString(), 365); - CookieParser.set(reply, "customization", cookieValue.toString(), 365); - - return { ok: true, message: "Updated consents cookies" }; -} diff --git a/app-old/components/common/Cookies.tsx b/app-old/components/common/Cookies.tsx deleted file mode 100644 index 1074590..0000000 --- a/app-old/components/common/Cookies.tsx +++ /dev/null @@ -1,192 +0,0 @@ -import { onUpdateConsentCookie, onSetAllConsentCookie, type ConsentCookies } from "./Cookies.telefunc"; -import React, { useState, useContext, createContext, useMemo } from "react"; -import { usePageContext } from "vike-react/usePageContext"; -import { reload } from "vike/client/router"; -import { Button } from "@syntax/Button"; -import { toast } from "react-toastify"; -import { Toggle } from "./Toggle"; -import { Link } from "./Link"; - -export const CookiesContext = createContext<{ - cookies: { - analytics: boolean; - customization: boolean; - }; - setCookie: (cookieName: ConsentCookies, cookieValue: boolean) => void; - setAllCookies: (cookieValue: boolean) => void; - isOpen: boolean; - setIsOpen: (isOpen: boolean) => void; - isSelectionOpen: boolean; - setIsSelectionOpen: (isSelectionOpen: boolean) => void; -}>({ - cookies: { - analytics: false, - customization: false, - }, - setCookie: (_cookieName: ConsentCookies, _cookieValue: boolean) => {}, - setAllCookies: () => {}, - isOpen: false, - setIsOpen: () => {}, - isSelectionOpen: false, - setIsSelectionOpen: () => {}, -}); - -type CookiesContainerProps = { - children?: React.ReactNode; -}; - -export function CookiesContainer(props: CookiesContainerProps) { - const { cookies } = usePageContext(); - - const [consentCookies, setConsentCookies] = useState(cookies.consent); - const [isSelectionOpen, setIsSelectionOpen] = useState(false); - const [isOpen, setIsOpen] = useState(() => { - return !Object.keys(cookies.consent).every((value) => value); - }); - - const toastPromiseMessages = useMemo( - () => ({ - pending: "Mise à jour des cookies...", - success: "Cookies mis à jour !", - error: "Erreur lors de la mise à jour des cookies", - }), - [], - ); - - const handleUpdateCookie = (cookieName: ConsentCookies, cookieValue: boolean) => { - setConsentCookies((prev) => ({ - ...prev, - [cookieName]: cookieValue, - })); - - toast.promise(onUpdateConsentCookie(cookieName, cookieValue), toastPromiseMessages).then(() => { - setIsOpen(false); - reload(); - }); - }; - - const handleSetAll = (value: boolean) => { - setConsentCookies({ analytics: true, customization: true }); - - toast.promise(onSetAllConsentCookie(value), toastPromiseMessages).then(() => { - setIsOpen(false); - setIsSelectionOpen(false); - reload(); - }); - }; - - return ( - - {props.children} - {isSelectionOpen && } - {isOpen && } - - ); -} - -function CookieChoices() { - const cookiesContext = useContext(CookiesContext); - - return ( -
-
- - -

Personnalisation des cookies 🍪

- -
- cookiesContext.setCookie("analytics", checked)} - /> - - cookiesContext.setCookie("customization", checked)} - /> -
-
-
- ); -} - -function CookieModal() { - const cookiesContext = useContext(CookiesContext); - - return ( -
- - -
-

- Coucou c'est nous... -
- les cookies ! 🍪 -

- -

- On ne t‘embête pas longtemps, on te laisse même le choix (si ça c‘est pas la classe 😎). -

- -

- Si tu veux en savoir plus, tu peux consulter la page{" "} - - Politique de confidentialité - - . -

-
- -
- - - - - -
-
- ); -} diff --git a/app-old/components/common/Iframe.tsx b/app-old/components/common/Iframe.tsx deleted file mode 100644 index 4682821..0000000 --- a/app-old/components/common/Iframe.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from "react"; -import clsx from "clsx"; - -type IframeProps = { - src: string; - width?: string; - height?: string; - className?: string; -}; - -export function Iframe(props: IframeProps) { - return ( -