From d3afc1d1f4a79ac49b90559d9a65bac86c251b15 Mon Sep 17 00:00:00 2001 From: Timothy Armes Date: Mon, 17 Jul 2023 11:49:07 +0200 Subject: [PATCH] Prettify all files --- .prettierrc | 5 +++ .vscode/settings.json | 2 +- README.md | 8 +++- app/[lang]/components/Footer.tsx | 2 +- app/[lang]/tournois/Legend.tsx | 12 +++--- app/[lang]/tournois/ScrollToTopButton.tsx | 2 +- app/[lang]/tournois/TournamentMap.tsx | 14 +++---- app/[lang]/tournois/TournamentMarker.tsx | 4 +- app/[lang]/tournois/TournamentTable.tsx | 8 ++-- app/api/send-mail/route.ts | 2 +- app/atoms.ts | 38 ++++++++++--------- app/sitemap.ts | 41 ++++++++++---------- css/marker-cluster.css | 16 ++++---- css/theme-toggle.css | 46 +++++++++++------------ cypress/component/themeToggle.cy.tsx | 4 +- cypress/e2e/data.cy.ts | 2 +- cypress/e2e/links.cy.ts | 2 +- cypress/support/component-index.html | 8 ++-- cypress/support/e2e.ts | 4 +- global.d.ts | 2 +- google48fe072216892488.html | 2 +- hooks/useContactForm.ts | 2 +- hooks/useDarkMode.ts | 2 +- i18n.ts | 6 +-- messages/en.json | 4 +- messages/fr.json | 4 +- middleware.ts | 10 ++--- next.config.js | 4 +- postcss.config.js | 2 +- prettier.config.js | 3 -- tailwind.config.js | 8 ++-- tsconfig.json | 8 +++- types.ts | 2 +- utils/atomWithDebounce.ts | 8 ++-- 34 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 .prettierrc delete mode 100644 prettier.config.js diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..3e7b163 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "trailingComma": "all", + "bracketSpacing": true, + "plugins": ["prettier-plugin-tailwindcss"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 7a49787..7b53af0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,5 +27,5 @@ "unspiderfy" ], - "css.customData": [".vscode/tailwindcss.json"], + "css.customData": [".vscode/tailwindcss.json"] } diff --git a/README.md b/README.md index cd4a514..5759e60 100644 --- a/README.md +++ b/README.md @@ -10,18 +10,22 @@ ## A website displaying upcoming chess tournaments for the [FFE](http://www.echecs.asso.fr/) on a map ## Tech Stack + This website is built in Typescript using: + - [Next.js](https://nextjs.org/) - [Tailwind](https://tailwindcss.com/) - [MongoDB](https://www.mongodb.com/) -- [Cypress](https://www.cypress.io/) +- [Cypress](https://www.cypress.io/) and is deployed on [Vercel](https://vercel.com/) ## Dependencies + - [Leaflet](https://leafletjs.com/) - a Javascript library for interactive maps - [Nodemailer](https://nodemailer.com/) - a module for Node.js applications to allow easy as cake email sending ## Contributions + Contributions are encouraged. Please open an issue to discuss your ideas. -Add your code into a feature branch such as `feature/feature-name`. We utilise a [GitHub Flow](https://www.gitkraken.com/learn/git/best-practices/git-branch-strategy#github-flow-considerations) branching strategy. +Add your code into a feature branch such as `feature/feature-name`. We utilise a [GitHub Flow](https://www.gitkraken.com/learn/git/best-practices/git-branch-strategy#github-flow-considerations) branching strategy. diff --git a/app/[lang]/components/Footer.tsx b/app/[lang]/components/Footer.tsx index f653917..0c6e1b0 100644 --- a/app/[lang]/components/Footer.tsx +++ b/app/[lang]/components/Footer.tsx @@ -31,7 +31,7 @@ export default function Footer() { > -
+
FR diff --git a/app/[lang]/tournois/Legend.tsx b/app/[lang]/tournois/Legend.tsx index 87a0e59..ec0b588 100644 --- a/app/[lang]/tournois/Legend.tsx +++ b/app/[lang]/tournois/Legend.tsx @@ -20,7 +20,7 @@ const Legend = () => { { tc: TimeControl.Blitz, colour: "#cec348" }, { tc: TimeControl.Other, colour: "#d10c3e" }, ].filter(({ tc }) => tournaments.some((t) => t.timeControl === tc)), - [tournaments] + [tournaments], ); useEffect(() => { @@ -32,7 +32,7 @@ const Legend = () => { const div = L.DomUtil.create("div", "map-legend"); div.setAttribute( "style", - "background: white; color: black; border: 2px solid grey; border-radius: 6px; padding: 10px;" + "background: white; color: black; border: 2px solid grey; border-radius: 6px; padding: 10px;", ); div.innerHTML = ` @@ -42,11 +42,11 @@ const Legend = () => { ({ tc, colour }) => `
  • ${t( - "timeControlEnum", - { tc } - )} + "timeControlEnum", + { tc }, + )}
  • - ` + `, ) .join("")} `; diff --git a/app/[lang]/tournois/ScrollToTopButton.tsx b/app/[lang]/tournois/ScrollToTopButton.tsx index f7d702d..928ecef 100644 --- a/app/[lang]/tournois/ScrollToTopButton.tsx +++ b/app/[lang]/tournois/ScrollToTopButton.tsx @@ -5,7 +5,7 @@ import { ScrollableElement } from "@/types"; import { FaArrowUp } from "react-icons/fa"; import { handleScrollToTop } from "@/handlers/scrollHandlers"; import { useEffect, useRef, useState } from "react"; -import {useBreakpoint} from "@/hooks/tailwind"; +import { useBreakpoint } from "@/hooks/tailwind"; const ScrollToTopButton = () => { const scrollToTopElementRef = useRef(null); diff --git a/app/[lang]/tournois/TournamentMap.tsx b/app/[lang]/tournois/TournamentMap.tsx index 091044c..53f4d3d 100644 --- a/app/[lang]/tournois/TournamentMap.tsx +++ b/app/[lang]/tournois/TournamentMap.tsx @@ -99,11 +99,11 @@ const TimeControlGroup = ({ timeControl, colour }: TimeControlGroupProps) => { const filteredTournaments = useMemo( () => tournaments.filter((t) => t.timeControl === timeControl), - [timeControl, tournaments] + [timeControl, tournaments], ); const hoveredListTournamentId = useAtomValue( - debouncedHoveredListTournamentIdAtom + debouncedHoveredListTournamentIdAtom, ); const expandAndBounceIfNeeded = useCallback(() => { @@ -167,7 +167,7 @@ const TimeControlGroup = ({ timeControl, colour }: TimeControlGroupProps) => { } } }, - [hoveredListTournamentId] + [hoveredListTournamentId], ); const onUnSpiderified = useCallback( @@ -178,7 +178,7 @@ const TimeControlGroup = ({ timeControl, colour }: TimeControlGroupProps) => { // Once closed, we can expand the next group if needed expandAndBounceIfNeeded(); }, - [expandAndBounceIfNeeded] + [expandAndBounceIfNeeded], ); useEffect(() => { @@ -215,7 +215,7 @@ const TimeControlGroup = ({ timeControl, colour }: TimeControlGroupProps) => { iconSize: new L.Point(40, 40), }); }, - [timeControl] + [timeControl], ); const markers = filteredTournaments.map((tournament) => { @@ -242,7 +242,7 @@ const TimeControlGroup = ({ timeControl, colour }: TimeControlGroupProps) => { ), - [createClusterCustomIcon, markers] + [createClusterCustomIcon, markers], ); return group; @@ -251,7 +251,7 @@ const TimeControlGroup = ({ timeControl, colour }: TimeControlGroupProps) => { export default function TournamentMap() { const setMapBounds = useSetAtom(mapBoundsAtom); const hoveredListTournamentId = useAtomValue( - debouncedHoveredListTournamentIdAtom + debouncedHoveredListTournamentIdAtom, ); const classic = useAtomValue(classicAtom); diff --git a/app/[lang]/tournois/TournamentMarker.tsx b/app/[lang]/tournois/TournamentMarker.tsx index 9360f65..07f9c7c 100644 --- a/app/[lang]/tournois/TournamentMarker.tsx +++ b/app/[lang]/tournois/TournamentMarker.tsx @@ -35,7 +35,7 @@ export const TournamentMarker = forwardRef< }); const setHoveredMapTournamentId = useSetAtom( - debouncedHoveredMapTournamentIdAtom + debouncedHoveredMapTournamentIdAtom, ); const iconOptions = useMemo( @@ -48,7 +48,7 @@ export const TournamentMarker = forwardRef< popupAnchor: [1, -34], shadowSize: [41, 41], }), - [colour] + [colour], ); return ( diff --git a/app/[lang]/tournois/TournamentTable.tsx b/app/[lang]/tournois/TournamentTable.tsx index 165c92f..5dce438 100644 --- a/app/[lang]/tournois/TournamentTable.tsx +++ b/app/[lang]/tournois/TournamentTable.tsx @@ -26,10 +26,10 @@ export default function TournamentTable() { const [syncVisible, setSyncVisible] = useAtom(syncVisibleAtom); const hoveredMapTournamentId = useAtomValue(hoveredMapTournamentIdAtom); const debouncedHoveredMapTournamentId = useAtomValue( - debouncedHoveredMapTournamentIdAtom + debouncedHoveredMapTournamentIdAtom, ); const setHoveredListTournamentId = useSetAtom( - debouncedHoveredListTournamentIdAtom + debouncedHoveredListTournamentIdAtom, ); const isLg = useBreakpoint("lg"); @@ -38,7 +38,7 @@ export default function TournamentTable() { if (!isLg || debouncedHoveredMapTournamentId === null) return; const tournamentRow = document.getElementById( - debouncedHoveredMapTournamentId + debouncedHoveredMapTournamentId, ); tournamentRow?.scrollIntoView({ behavior: "smooth" }); @@ -110,7 +110,7 @@ export default function TournamentTable() { className={twMerge( "scroll-m-20 bg-white text-gray-900 hover:bg-gray-200 dark:bg-gray-800 dark:text-white dark:hover:bg-gray-900", hoveredMapTournamentId === tournament._id && - "bg-gray-200 dark:bg-gray-900" + "bg-gray-200 dark:bg-gray-900", )} > {tournament.date} diff --git a/app/api/send-mail/route.ts b/app/api/send-mail/route.ts index 3a30cf1..fa292cc 100644 --- a/app/api/send-mail/route.ts +++ b/app/api/send-mail/route.ts @@ -27,7 +27,7 @@ export async function POST(req: Request) { return NextResponse.json( { success: `Message delivered to ${mailInfo.accepted}` }, - { status: 250 } + { status: 250 }, ); } catch (error) { errorLog(error); diff --git a/app/atoms.ts b/app/atoms.ts index 81b1313..f217643 100644 --- a/app/atoms.ts +++ b/app/atoms.ts @@ -1,6 +1,6 @@ -import { TimeControl, Tournament } from '@/types'; -import { atom } from 'jotai'; -import { LatLngBounds } from 'leaflet'; +import { TimeControl, Tournament } from "@/types"; +import { atom } from "jotai"; +import { LatLngBounds } from "leaflet"; import atomWithDebounce from "@/utils/atomWithDebounce"; @@ -8,7 +8,7 @@ export const tournamentsAtom = atom([]); export const mapBoundsAtom = atom(null); export const syncVisibleAtom = atom(true); -export const searchStringAtom = atom(''); +export const searchStringAtom = atom(""); export const classicAtom = atom(true); export const rapidAtom = atom(true); export const blitzAtom = atom(true); @@ -19,9 +19,8 @@ export const { debouncedValueAtom: debouncedHoveredMapTournamentIdAtom, } = atomWithDebounce(null); -export const { - debouncedValueAtom: debouncedHoveredListTournamentIdAtom, -} = atomWithDebounce(null, 300, true); +export const { debouncedValueAtom: debouncedHoveredListTournamentIdAtom } = + atomWithDebounce(null, 300, true); export const filteredTournamentsByTimeControlAtom = atom((get) => { const tournaments = get(tournamentsAtom); @@ -31,11 +30,13 @@ export const filteredTournamentsByTimeControlAtom = atom((get) => { const blitz = get(blitzAtom); const other = get(otherAtom); - return tournaments.filter(tournament => - (tournament.timeControl === TimeControl.Classic && classic) || - (tournament.timeControl === TimeControl.Rapid && rapid) || - (tournament.timeControl === TimeControl.Blitz && blitz) || - (tournament.timeControl === TimeControl.Other && other)); + return tournaments.filter( + (tournament) => + (tournament.timeControl === TimeControl.Classic && classic) || + (tournament.timeControl === TimeControl.Rapid && rapid) || + (tournament.timeControl === TimeControl.Blitz && blitz) || + (tournament.timeControl === TimeControl.Other && other), + ); }); export const filteredTournamentsListAtom = atom((get) => { @@ -45,14 +46,17 @@ export const filteredTournamentsListAtom = atom((get) => { const searchString = get(searchStringAtom).trim(); - // When searching, we search all the tournament, regardless of the map display - if (searchString !== '') - return tournaments.filter((t) => t.town.includes(searchString.toUpperCase())) + if (searchString !== "") + return tournaments.filter((t) => + t.town.includes(searchString.toUpperCase()), + ); // If we not syncing to the map, return all tournaments if (mapBounds === null || !syncVisible) return tournaments; // Filter by those in the current map bounds - return tournaments.filter(tournament => mapBounds.contains(tournament.latLng)) -}) + return tournaments.filter((tournament) => + mapBounds.contains(tournament.latLng), + ); +}); diff --git a/app/sitemap.ts b/app/sitemap.ts index 924f7c7..593928b 100644 --- a/app/sitemap.ts +++ b/app/sitemap.ts @@ -1,24 +1,27 @@ import { MetadataRoute } from "next"; export default function sitemap(): MetadataRoute.Sitemap { - return ['fr', 'en'].flatMap(locale => { - const prefix = `https://echecsfrance.com/${locale === 'fr' ? '' : `${locale}/`}` + return ["fr", "en"].flatMap((locale) => { + const prefix = `https://echecsfrance.com/${ + locale === "fr" ? "" : `${locale}/` + }`; return [ - { - url: prefix, - lastModified: new Date(), - }, - { - url: `${prefix}tournois`, - lastModified: new Date(), - }, - { - url: `${prefix}qui-sommes-nous`, - lastModified: new Date(), - }, - { - url: `${prefix}contactez-nous`, - lastModified: new Date(), - }, - ]}); + { + url: prefix, + lastModified: new Date(), + }, + { + url: `${prefix}tournois`, + lastModified: new Date(), + }, + { + url: `${prefix}qui-sommes-nous`, + lastModified: new Date(), + }, + { + url: `${prefix}contactez-nous`, + lastModified: new Date(), + }, + ]; + }); } diff --git a/css/marker-cluster.css b/css/marker-cluster.css index 0d4ac5e..b8c5347 100644 --- a/css/marker-cluster.css +++ b/css/marker-cluster.css @@ -1,31 +1,31 @@ .marker-cluster-Classic { - background-color: rgba(145, 231, 135, 0.6); + background-color: rgba(145, 231, 135, 0.6); } .marker-cluster-Classic div { - background-color: rgba(36, 171, 33, 0.6) + background-color: rgba(36, 171, 33, 0.6); } .marker-cluster-Rapid { - background-color: rgba(85, 150, 201, 0.6) + background-color: rgba(85, 150, 201, 0.6); } .marker-cluster-Rapid div { - background-color: rgba(39, 128, 201, 0.6) + background-color: rgba(39, 128, 201, 0.6); } .marker-cluster-Blitz { - background-color: rgba(217, 211, 84, 0.6); + background-color: rgba(217, 211, 84, 0.6); } .marker-cluster-Blitz div { - background-color: rgba(202, 196, 39, 0.6) + background-color: rgba(202, 196, 39, 0.6); } .marker-cluster-Other { - background-color: rgba(211, 67, 84, 0.6); + background-color: rgba(211, 67, 84, 0.6); } .marker-cluster-Other div { - background-color: rgba(203, 41, 60, 0.6); + background-color: rgba(203, 41, 60, 0.6); } diff --git a/css/theme-toggle.css b/css/theme-toggle.css index 44cf05c..0852b8d 100644 --- a/css/theme-toggle.css +++ b/css/theme-toggle.css @@ -1,30 +1,30 @@ .toggle { - height: 2em; - width: 3em; - border-radius: 50px; - margin: auto; - background-image: linear-gradient(aqua, skyblue); - position: relative; - cursor: pointer; + height: 2em; + width: 3em; + border-radius: 50px; + margin: auto; + background-image: linear-gradient(aqua, skyblue); + position: relative; + cursor: pointer; } .toggle-dark { - height: 2em; - width: 3em; - border-radius: 50px; - margin: auto; - background-image: linear-gradient(midnightblue, rebeccapurple); - position: relative; - cursor: pointer; + height: 2em; + width: 3em; + border-radius: 50px; + margin: auto; + background-image: linear-gradient(midnightblue, rebeccapurple); + position: relative; + cursor: pointer; } -.theme-icon{ - margin-left: 0.2em; - height: 2em; - width: 1.2em; - color: yellow; +.theme-icon { + margin-left: 0.2em; + height: 2em; + width: 1.2em; + color: yellow; } -.theme-icon-dark{ - height: 2em; - width: 1.2em; - margin-left: auto; +.theme-icon-dark { + height: 2em; + width: 1.2em; + margin-left: auto; } diff --git a/cypress/component/themeToggle.cy.tsx b/cypress/component/themeToggle.cy.tsx index 2f2a186..e728f0d 100644 --- a/cypress/component/themeToggle.cy.tsx +++ b/cypress/component/themeToggle.cy.tsx @@ -11,7 +11,7 @@ describe("ThemeSwitcher component", () => { cy.getByData("toggle").should(($toggle) => { const backgroundImage = $toggle.css("background-image"); expect(backgroundImage).to.include( - "linear-gradient(rgb(0, 255, 255), rgb(135, 206, 235)" + "linear-gradient(rgb(0, 255, 255), rgb(135, 206, 235)", ); }); @@ -21,7 +21,7 @@ describe("ThemeSwitcher component", () => { cy.getByData("toggle-dark").should(($toggle) => { const backgroundImage = $toggle.css("background-image"); expect(backgroundImage).to.include( - "linear-gradient(rgb(25, 25, 112), rgb(102, 51, 153)" + "linear-gradient(rgb(25, 25, 112), rgb(102, 51, 153)", ); }); }); diff --git a/cypress/e2e/data.cy.ts b/cypress/e2e/data.cy.ts index b134c72..6545fa5 100644 --- a/cypress/e2e/data.cy.ts +++ b/cypress/e2e/data.cy.ts @@ -21,7 +21,7 @@ describe("Data fetching from API endpoints", () => { const responseData = response.body; const itemCount = responseData.length; expect(itemCount).to.eq(tableRows); - } + }, ); }); }); diff --git a/cypress/e2e/links.cy.ts b/cypress/e2e/links.cy.ts index c9bf573..aaadd71 100644 --- a/cypress/e2e/links.cy.ts +++ b/cypress/e2e/links.cy.ts @@ -66,7 +66,7 @@ describe("Test links", () => { }); cy.log(link.prop("href")); } - } + }, ); }); }); diff --git a/cypress/support/component-index.html b/cypress/support/component-index.html index 3a2b4ff..bd7cfe6 100644 --- a/cypress/support/component-index.html +++ b/cypress/support/component-index.html @@ -1,11 +1,11 @@ - + lUnknownTag --> - - - + + + Components App
    diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index f80f74f..6a173d6 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import "./commands"; // Alternatively you can use CommonJS syntax: -// require('./commands') \ No newline at end of file +// require('./commands') diff --git a/global.d.ts b/global.d.ts index cb7c75a..2799e9a 100644 --- a/global.d.ts +++ b/global.d.ts @@ -1,4 +1,4 @@ // Use type safe message keys with `next-intl` -type Messages = typeof import('./messages/fr.json'); +type Messages = typeof import("./messages/fr.json"); declare interface IntlMessages extends Messages {} diff --git a/google48fe072216892488.html b/google48fe072216892488.html index adc3609..082012c 100644 --- a/google48fe072216892488.html +++ b/google48fe072216892488.html @@ -1 +1 @@ -google-site-verification: google48fe072216892488.html \ No newline at end of file +google-site-verification: google48fe072216892488.html diff --git a/hooks/useContactForm.ts b/hooks/useContactForm.ts index f917a5c..c6f3842 100644 --- a/hooks/useContactForm.ts +++ b/hooks/useContactForm.ts @@ -8,7 +8,7 @@ const useContactForm = () => { }); const handleChange = ( - e: ChangeEvent + e: ChangeEvent, ) => { setValues((prevState) => { return { diff --git a/hooks/useDarkMode.ts b/hooks/useDarkMode.ts index 754a4c6..53fffe0 100644 --- a/hooks/useDarkMode.ts +++ b/hooks/useDarkMode.ts @@ -8,7 +8,7 @@ function useDarkMode(): [string, Dispatch>] { const [theme, setTheme] = useState( typeof window !== "undefined" ? localStorage.theme || (prefersDarkMode ? "dark" : "light") - : "dark" + : "dark", ); const colorTheme = theme === "dark" ? "light" : "dark"; diff --git a/i18n.ts b/i18n.ts index 457316b..b1b57de 100644 --- a/i18n.ts +++ b/i18n.ts @@ -1,5 +1,5 @@ -import {getRequestConfig} from 'next-intl/server'; +import { getRequestConfig } from "next-intl/server"; -export default getRequestConfig(async ({locale}) => ({ - messages: (await import(`./messages/${locale}.json`)).default +export default getRequestConfig(async ({ locale }) => ({ + messages: (await import(`./messages/${locale}.json`)).default, })); diff --git a/messages/en.json b/messages/en.json index a5ed233..da3b400 100644 --- a/messages/en.json +++ b/messages/en.json @@ -42,7 +42,7 @@ "About": { "title": "Who are we?", "p1": "This project came to life in early 2022 with the aim of providing a visualization of chess tournaments on a map in France. Having moved to France in 2019, I was not familiar with the geography of the country and wanted to know which tournaments were taking place near my location.", - "p2": "The project was put on hold until spring 2023, when I revived it. Rebuilt from scratch, Échecs France is now open source and open to contributions. You can find more information and access the project at Échecs France", + "p2": "The project was put on hold until spring 2023, when I revived it. Rebuilt from scratch, Échecs France is now open source and open to contributions. You can find more information and access the project at Échecs France", "p3": " I plan to implement an online donation button for those who wish to contribute to the expenses associated with the website. Once the operating costs are deducted, any remaining funds will be redirected to the chess community, either by sponsoring events or through the creation of donations.", "thanksTitle": "Thanks", "thanksInfo": "This project is what it is thanks to the contributions of all of you. I would like to extend special thanks to the following individuals for their contributions:", @@ -65,5 +65,5 @@ "sending": "Sending...", "success": "Thank you for your message.", "failure": "Sorry, something went wrong. Please try again." - } + } } diff --git a/messages/fr.json b/messages/fr.json index cd15777..46af5b3 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -42,7 +42,7 @@ "About": { "title": "Qui Sommes-Nous?", "p1": "Ce projet a vu le jour début 2022 afin de permettre une visualisation sur une carte des tournois d'échecs en France. Ayant déménagé en France en 2019, je ne connaissais alors pas la géographie française et je souhaitais savoir quels tournois avaient lieu près de chez moi.", - "p2": "Le projet a été mis de côté jusqu'au printemps 2023; date à laquelle je lui ai redonné vie. Reconstruit à partir de zéro, Échecs France est désormais open source et ouvert aux contributions.", + "p2": "Le projet a été mis de côté jusqu'au printemps 2023; date à laquelle je lui ai redonné vie. Reconstruit à partir de zéro, Échecs France est désormais open source et ouvert aux contributions.", "p3": "Je compte mettre en place un bouton de don en ligne pour ceux qui souhaitent participer aux frais associés au site. Une fois les coûts de fonctionnement déduits, tous les fonds restant seront redirigés vers le monde des échecs soit en sponsorant des événements ou par la création de dons.", "thanksTitle": "Remerciements", "thanksInfo": "Ce projet est ce qu'il est grâce aux contributions de vous tous. Je souhaite en particulier remercier les personnes suivantes pour leurs contributions\u00a0:", @@ -65,5 +65,5 @@ "sending": "Envoi en cours...", "success": "Merci pour votre message.", "failure": "Oops, quelque chose ne va pas. Veuillez réessayer SVP." - } + } } diff --git a/middleware.ts b/middleware.ts index 090b9ba..723120c 100644 --- a/middleware.ts +++ b/middleware.ts @@ -1,15 +1,15 @@ -import createMiddleware from 'next-intl/middleware'; +import createMiddleware from "next-intl/middleware"; export default createMiddleware({ // A list of all locales that are supported - locales: ['fr', 'en'], + locales: ["fr", "en"], // If this locale is matched, pathnames work without a prefix (e.g. `/tournois`) - defaultLocale: 'fr' + defaultLocale: "fr", }); export const config = { // Skip all paths that should not be internationalized. This example skips certain folders // such as "api", and all files with an extension (e.g. favicon.ico) - matcher: ['/((?!api|_next|robots|.*\\..*).*)'] -} + matcher: ["/((?!api|_next|robots|.*\\..*).*)"], +}; diff --git a/next.config.js b/next.config.js index bce24da..d8a0750 100644 --- a/next.config.js +++ b/next.config.js @@ -5,9 +5,7 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({ enabled: process.env.ANALYZE === "true", }); -const withNextIntl = require('next-intl/plugin')( - './i18n.ts' -); +const withNextIntl = require("next-intl/plugin")("./i18n.ts"); module.exports = nextConfig; module.exports = withBundleAnalyzer(withNextIntl({})); diff --git a/postcss.config.js b/postcss.config.js index 33ad091..12a703d 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/prettier.config.js b/prettier.config.js deleted file mode 100644 index f852487..0000000 --- a/prettier.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - plugins: [require('prettier-plugin-tailwindcss')], -} diff --git a/tailwind.config.js b/tailwind.config.js index 90c2043..dfb3d95 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -11,12 +11,12 @@ module.exports = { minHeight: { // We use 100svh, falling back to vh for old browsers // The 144px is for the header and footer - content: ['calc(100vh - 144px)', 'calc(100svh - 144px)'], + content: ["calc(100vh - 144px)", "calc(100svh - 144px)"], }, height: { - content: ['calc(100vh - 144px)', 'calc(100svh - 144px)'], - } - } + content: ["calc(100vh - 144px)", "calc(100svh - 144px)"], + }, + }, }, plugins: [], }; diff --git a/tsconfig.json b/tsconfig.json index 9d03c8a..bb18c57 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,6 +24,12 @@ "@/*": ["./*"] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "global.d.ts"], + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts", + "global.d.ts" + ], "exclude": ["node_modules"] } diff --git a/types.ts b/types.ts index 5d56ced..e677bac 100644 --- a/types.ts +++ b/types.ts @@ -5,7 +5,7 @@ export enum TimeControl { Rapid = "Rapid", Blitz = "Blitz", Other = "Other", -}; +} export interface Tournament { _id: string; diff --git a/utils/atomWithDebounce.ts b/utils/atomWithDebounce.ts index 8b94bc8..75001bb 100644 --- a/utils/atomWithDebounce.ts +++ b/utils/atomWithDebounce.ts @@ -3,10 +3,10 @@ import { atom, SetStateAction } from "jotai"; export default function atomWithDebounce( initialValue: T, delayMilliseconds = 500, - shouldDebounceOnReset = false + shouldDebounceOnReset = false, ) { const prevTimeoutAtom = atom | undefined>( - undefined + undefined, ); // DO NOT EXPORT currentValueAtom as using this atom to set state can cause @@ -48,7 +48,7 @@ export default function atomWithDebounce( // set previous timeout atom in case it needs to get cleared set(prevTimeoutAtom, nextTimeoutId); - } + }, ); // exported atom setter to clear timeout if needed @@ -61,6 +61,6 @@ export default function atomWithDebounce( currentValueAtom: atom((get) => get(_currentValueAtom)), isDebouncingAtom, clearTimeoutAtom, - debouncedValueAtom + debouncedValueAtom, }; }