diff --git a/.eslintrc.json b/.eslintrc.json index bffb357..108bcd3 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,3 +1,14 @@ { - "extends": "next/core-web-vitals" + "extends": ["next/core-web-vitals", "next/typescript", "prettier"], + "rules": { + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_", + "destructuredArrayIgnorePattern": "^_" + } + ] + } } diff --git a/package-lock.json b/package-lock.json index 12dc278..6dd7474 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,6 +28,7 @@ "@types/react-dom": "^19.1.7", "eslint": "^9.32.0", "eslint-config-next": "^15.4.5", + "eslint-config-prettier": "^9.1.0", "husky": "^9.1.6", "lint-staged": "^15.2.10", "openapi-typescript": "^7.4.1", @@ -3134,6 +3135,18 @@ } } }, + "node_modules/eslint-config-prettier": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.2.tgz", + "integrity": "sha512-iI1f+D2ViGn+uvv5HuHVUamg8ll4tN+JRHGc6IJi4TP9Kl976C57fzPXgseXNs8v0iA8aSJpHsTWjDb9QJamGQ==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", diff --git a/package.json b/package.json index acbb076..3d5bde6 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@types/react-dom": "^19.1.7", "eslint": "^9.32.0", "eslint-config-next": "^15.4.5", + "eslint-config-prettier": "^9.1.0", "husky": "^9.1.6", "lint-staged": "^15.2.10", "openapi-typescript": "^7.4.1", diff --git a/src/app/_components/timeClock/timeClock.tsx b/src/app/_components/timeClock/timeClock.tsx index 7c0984c..9db3209 100644 --- a/src/app/_components/timeClock/timeClock.tsx +++ b/src/app/_components/timeClock/timeClock.tsx @@ -1,174 +1,184 @@ "use client"; -import React, { useEffect } from 'react'; +import React, { useEffect } from "react"; const TimeClock: React.FC = () => { - useEffect(() => { + useEffect(() => { + const numbers = [ + [1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1], // 0 + [1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1], // 1 + [1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1], // 2 + [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1], // 3 + [1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1], // 4 + [1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1], // 5 + [1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1], // 6 + [1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0], // 7 + [1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1], // 8 + [1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1], // 9 + ]; - const numbers = [ - [1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1], // 0 - [1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1], // 1 - [1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1], // 2 - [1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1], // 3 - [1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1], // 4 - [1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1], // 5 - [1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1], // 6 - [1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0], // 7 - [1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1], // 8 - [1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1] // 9 - ]; + const blocks: Array = []; + const digits = Array.from(document.querySelectorAll(".block")); - const blocks: Array = []; - const digits = Array.from(document.querySelectorAll('.block')); + for (let i = 0; i < 4; i++) { + blocks.push(digits.slice(i * 15, i * 15 + 15)); + } - for (let i = 0; i < 4; i++) { - blocks.push(digits.slice(i * 15, i * 15 + 15)); + const setNum = (block: Array, num: number) => { + const n = numbers[num]; + for (let i = 0; i < block.length; i++) { + block[i].classList[n[i] === 1 ? "add" : "remove"]("active"); + } + }; + + const time = { + s: "", + m: "", + h: "", + p: 0, + }; + + // time loop + const animator = () => { + const d = new Date(); + let h = d.getHours().toString(), + m = d.getMinutes().toString(), + s = d.getSeconds().toString(); + + s = s.length === 1 ? "0" + s : s; + m = m.length === 1 ? "0" + m : m; + h = h.length === 1 ? "0" + h : h; + + if (s !== time.s) { + for (let i = 0; i < digits.length; i++) { + const d = digits[i]; + if (i === +s) { + d.classList.add("second"); + if (time.p !== null) digits[time.p].classList.remove("second"); + time.p = i; + time.s = s; + } } + } - const setNum = (block: Array, num: number) => { - let n = numbers[num]; - for (let i = 0; i < block.length; i++) { - block[i].classList[n[i] === 1 ? 'add' : 'remove']('active'); - } - }; + if (m !== time.m) { + setNum(blocks[2], parseInt(Array.from(m)[0])); + setNum(blocks[3], parseInt(Array.from(m)[1])); + time.m = m; + } - const time = { - s: '', - m: '', - h: '', - p: 0 - }; + if (h !== time.h) { + setNum(blocks[0], parseInt(Array.from(h)[0])); + setNum(blocks[1], parseInt(Array.from(h)[1])); + time.h = h; + } + window.requestAnimationFrame(animator); + }; - // time loop - const animator = () => { - let d = new Date(), - h = d.getHours().toString(), - m = d.getMinutes().toString(), - s = d.getSeconds().toString(); + // init + window.requestAnimationFrame(animator); - s = s.length === 1 ? '0' + s : s; - m = m.length === 1 ? '0' + m : m; - h = h.length === 1 ? '0' + h : h; + // toggle button + const d = new Date(); + const days = ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"]; + const months = [ + "Janvier", + "Février", + "Mars", + "Avril", + "Mai", + "Juin", + "Juillet", + "Août", + "Septembre", + "Octobre", + "Novembre", + "Décembre", + ]; + const lib_d = days[d.getDay()]; + const lib_m = months[d.getMonth()]; + const lib_n = d.getDate(); + const lib_y = d.getFullYear(); + document.getElementById("datelib")!.innerHTML = lib_d + " " + lib_n + " " + lib_m + " " + lib_y; + }, []); - if (s !== time.s) { - for (let i = 0; i < digits.length; i++) { - let d = digits[i]; - if (i === +s) { - d.classList.add('second'); - if (time.p !== null) - digits[time.p].classList.remove('second'); - time.p = i; - time.s = s; - } - } - } - - if (m !== time.m) { - setNum(blocks[2], parseInt(Array.from(m)[0])); - setNum(blocks[3], parseInt(Array.from(m)[1])); - time.m = m; - } - - if (h !== time.h) { - setNum(blocks[0], parseInt(Array.from(h)[0])); - setNum(blocks[1], parseInt(Array.from(h)[1])); - time.h = h; - } - window.requestAnimationFrame(animator) - } - - // init - window.requestAnimationFrame(animator) - - // toggle button - var d = new Date(); - var days = ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"]; - var months = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"]; - var lib_d = days[d.getDay()]; - var lib_m = months[d.getMonth()]; - var lib_n = d.getDate(); - var lib_y = d.getFullYear(); - document.getElementById("datelib")!.innerHTML = lib_d + " " + lib_n + " " + lib_m + " " + lib_y; - - }, []); - - return ( - <> -
-
-
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - ); + return ( + <> +
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + ); }; export default TimeClock; diff --git a/src/app/article/[slug]/_components/articleArea/articleArea.tsx b/src/app/article/[slug]/_components/articleArea/articleArea.tsx index 90c8fd9..bcefd94 100644 --- a/src/app/article/[slug]/_components/articleArea/articleArea.tsx +++ b/src/app/article/[slug]/_components/articleArea/articleArea.tsx @@ -7,6 +7,7 @@ import { convertMarkdownToHtml } from "@/modules/features/article/functions"; import { FollowButton } from "@/modules/features/profile/components/followButton"; import { Article, User } from "@/utils/types/models"; import Link from "next/link"; +import Image from "next/image"; import { ReactNode } from "react"; import styles from "./articleArea.module.css"; import { showDeleteArticleButton, showEditArticleButton, showFollowButton } from "./functions"; @@ -18,7 +19,7 @@ const Actions = ({ article, currentUser }: { article: Article; currentUser?: Use return (
- {profile.image && } + {profile.image && }
{profile.username} diff --git a/src/app/article/[slug]/_components/commentCard/presentation.tsx b/src/app/article/[slug]/_components/commentCard/presentation.tsx index e5cb33f..eb361be 100644 --- a/src/app/article/[slug]/_components/commentCard/presentation.tsx +++ b/src/app/article/[slug]/_components/commentCard/presentation.tsx @@ -1,5 +1,6 @@ -import { Comment } from "@/utils/types/models"; import Link from "next/link"; +import Image from "next/image"; +import { Comment } from "@/utils/types/models"; import styles from "./presentation.module.css"; type Props = { @@ -17,7 +18,7 @@ export const CommentCard = ({ comment, showDeleteCommentButton, deleteCommentAct
- {comment.author.image && } + {comment.author.image && }   diff --git a/src/app/article/[slug]/_components/commentForm/presentation.tsx b/src/app/article/[slug]/_components/commentForm/presentation.tsx index 501475a..1118aa7 100644 --- a/src/app/article/[slug]/_components/commentForm/presentation.tsx +++ b/src/app/article/[slug]/_components/commentForm/presentation.tsx @@ -1,3 +1,4 @@ +import Image from "next/image"; import { Button } from "@/modules/common/components/button"; import { ErrorMessage } from "@/modules/common/components/errorMessage"; import { SubmissionResult, useForm } from "@conform-to/react"; @@ -51,7 +52,7 @@ export const CommentForm = ({ slug, authorImage, result, postCommentAction, isPe
- {authorImage && } + {authorImage && } diff --git a/src/app/page.tsx b/src/app/page.tsx index 0670932..d277b53 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -12,80 +12,78 @@ import { SearchParams } from "./_types"; import TimeClock from "./_components/timeClock/timeClock"; const ArticleList = (searchParams: SearchParams) => { - switch (searchParams.tab) { - case "yours": - return ; - case "global": - return ; - case "tag": - return ; - default: - throw new ExhaustiveError(searchParams.tab, "all tab cases are not covered"); - } + switch (searchParams.tab) { + case "yours": + return ; + case "global": + return ; + case "tag": + return ; + default: + throw new ExhaustiveError(searchParams.tab, "all tab cases are not covered"); + } }; const Page = async (props: { searchParams: Promise<{ [key: string]: string | string[] | undefined }> }) => { - const session = await getSession(); - const searchParams = SearchParams.parse(await props.searchParams); + const session = await getSession(); + const searchParams = SearchParams.parse(await props.searchParams); - return ( -
- - - -

Ad Astra, bientôt en ligne!

-

- Encore un peu de patience, notre site sera disponible d'ici peu. -

- - - - -
-
- -
- - -
-
    - {session && ( -
  • - - Your Feed - -
  • - )} -
  • - - Global Feed - -
  • - {searchParams.tag && ( -
  • - - #{searchParams.tag} - -
  • - )} -
-
- ⌛Chargement...

}> - -
- - - ⌛Chargement...

}> - -
- -
-
-
- ); + return ( +
+ + + +

Ad Astra, bientôt en ligne!

+

Encore un peu de patience, notre site sera disponible d'ici peu.

+ + + + +
+
+ +
+ + +
+
    + {session && ( +
  • + + Your Feed + +
  • + )} +
  • + + Global Feed + +
  • + {searchParams.tag && ( +
  • + + #{searchParams.tag} + +
  • + )} +
+
+ ⌛Chargement...

}> + +
+ + + ⌛Chargement...

}> + +
+ +
+
+
+ ); }; export default Page; diff --git a/src/app/profile/[username]/layout.tsx b/src/app/profile/[username]/layout.tsx index f8c9692..3655287 100644 --- a/src/app/profile/[username]/layout.tsx +++ b/src/app/profile/[username]/layout.tsx @@ -1,9 +1,10 @@ +import { ReactNode } from "react"; +import Image from "next/image"; import { Button } from "@/modules/common/components/button"; import { fetchCurrentUser } from "@/modules/features/auth/fetch/fetchCurrentUser"; import { FollowButton } from "@/modules/features/profile/components/followButton"; import { fetchProfile } from "@/modules/features/profile/fetch/fetchProfile"; import { getSession } from "@/utils/auth/session"; -import { ReactNode } from "react"; import { showEditProfileSettingsButton, showFollowButton } from "./_functions"; type Props = { @@ -23,7 +24,7 @@ const Layout = async ({ children, params }: Props) => {
- {profile.image && } + {profile.image && }

{profile.username}

{profile.bio &&

{profile.bio}

} {showFollowButton(profile.username, currentUser) && } diff --git a/src/modules/common/components/footer/footer.tsx b/src/modules/common/components/footer/footer.tsx index 7b0f12e..c93ae70 100644 --- a/src/modules/common/components/footer/footer.tsx +++ b/src/modules/common/components/footer/footer.tsx @@ -1,68 +1,130 @@ import Link from "next/link"; import LogoSmall from "@/app/_components/layoutElements/logoSmall"; -import { ComponentPropsWithoutRef } from "react"; +//import { ComponentPropsWithoutRef } from "react"; -type Props = ComponentPropsWithoutRef<"footer">; +//type Props = ComponentPropsWithoutRef<"footer">; -export const Footer = (props: Props) => ( -
-
-
-
- - - -
    -
  • - L'équipe de passionnés Ad Astra est réactive et à l'écoute de vos demandes afin de vous accompagner au mieux et satisfaire vos besoins en fleurs et hashes CBD de qualité. -
  • -
  • - Exigez la qualité Ad Astra, vous la méritez. -
  • -
-
-
-
Nos produits
-
    -
  • Accueil
  • -
  • Lien 2
  • -
  • Lien 3
  • -
  • Lien 4
  • -
  • Lien 5
  • -
-
-
-
Documentation
-
    -
  • Les fleurs
  • -
  • Les hashes
  • -
  • Les molécules
  • -
  • Les concentrés
  • -
-
-
-
Professionels
-
    -
  • Catalogue B2B
  • -
  • Lien 2
  • -
  • Lien 3
  • -
  • Lien 4
  • -
  • Lien 5
  • -
-
-
-
Contact
-
    -
  • Lien 1
  • -
  • Lien 2
  • -
  • Lien 3
  • -
  • Lien 4
  • -
  • Lien 5
  • -
-
-
-
-
-

Copyright © 2025 Ad Astra

-
+export const Footer = () => ( +
+
+
+
+ + + +
    +
  • + L'équipe de passionnés Ad Astra est réactive et à l'écoute de vos demandes afin de vous + accompagner au mieux et satisfaire vos besoins en fleurs et hashes CBD de qualité. +
  • +
  • Exigez la qualité Ad Astra, vous la méritez.
  • +
+
+
+
Nos produits
+
    +
  • + Accueil +
  • +
  • + Lien 2 +
  • +
  • + Lien 3 +
  • +
  • + Lien 4 +
  • +
  • + Lien 5 +
  • +
+
+
+
Documentation
+
    +
  • + Les fleurs +
  • +
  • + Les hashes +
  • +
  • + Les molécules +
  • +
  • + Les concentrés +
  • +
+
+
+
Professionels
+
    +
  • + + Catalogue B2B + {" "} +
  • +
  • + + Lien 2 + {" "} +
  • +
  • + + Lien 3 + +
  • +
  • + + Lien 4 + +
  • +
  • + {" "} + + Lien 5 + {" "} +
  • +
+
+
+
Contact
+
    +
  • + + Lien 1 + {" "} +
  • +
  • + + Lien 2 + {" "} +
  • +
  • + + Lien 3 + {" "} +
  • +
  • + + Lien 4 + +
  • +
  • + + Lien 5 + {" "} +
  • +
+
+
+
+
+

Copyright © 2025 Ad Astra

+
); diff --git a/src/modules/features/article/components/articleCard/articleCard.tsx b/src/modules/features/article/components/articleCard/articleCard.tsx index ce7e287..509dc64 100644 --- a/src/modules/features/article/components/articleCard/articleCard.tsx +++ b/src/modules/features/article/components/articleCard/articleCard.tsx @@ -1,5 +1,6 @@ -import { ArticlePreview } from "@/utils/types/models"; +import Image from "next/image"; import Link from "next/link"; +import { ArticlePreview } from "@/utils/types/models"; import { Tag } from "../tag"; import { FavoriteButton } from "../favoriteButton"; @@ -13,7 +14,7 @@ export const ArticleCard = ({ article }: Props) => { return (
- {author.image && } + {author.image && }
{author.username}