Compare commits

...
10 Commits
36 changed files with 2682 additions and 5446 deletions
-6
View File
@@ -1,6 +0,0 @@
{
"extends": ["next", "next/core-web-vitals", "prettier"],
"globals": {
"React": "readonly"
}
}
+2
View File
@@ -12,6 +12,8 @@
# pwa # pwa
sw.* sw.*
workbox*.* workbox*.*
swe-worker*.*
!src/app/sw.ts
# testing # testing
/coverage /coverage
+4
View File
@@ -0,0 +1,4 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"ignorePatterns": ["leaflet.d.ts"]
}
+15
View File
@@ -0,0 +1,15 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": [
"typescript",
"unicorn",
"oxc"
],
"categories": {
"correctness": "error"
},
"rules": {},
"env": {
"builtin": true
}
}
-9
View File
@@ -1,9 +0,0 @@
{
"trailingComma": "all",
"bracketSpacing": true,
"plugins": ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"],
"importOrder": ["^react$", "^@?\\w", "^@\\\\", "<THIRD_PARTY_MODULES>", "^\\.\\.", "^\\."],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"tailwindFunctions": ["twMerge"]
}
+6
View File
@@ -0,0 +1,6 @@
{
"$schema": "https://unpkg.com/knip@6/schema.json",
"ignore": [],
"ignoreDependencies": [],
"tags": ["-lintignore"]
}
+18 -7
View File
@@ -1,5 +1,10 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = {}; const nextConfig = {
// react-leaflet v4 creates maps in a render-phase ref callback, which breaks
// under React dev StrictMode's double-mount ("Map container is already
// initialized"). StrictMode only runs in dev, so production is unaffected.
reactStrictMode: false,
};
const withBundleAnalyzer = require("@next/bundle-analyzer")({ const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true", enabled: process.env.ANALYZE === "true",
@@ -7,10 +12,16 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
const withNextIntl = require("next-intl/plugin")("./src/i18n.ts"); const withNextIntl = require("next-intl/plugin")("./src/i18n.ts");
const withPWA = require("next-pwa")({ // PWA service worker, generated with Serwist. It hooks into webpack, so it is
dest: "public", // only enabled for production builds (`next build --webpack`) and disabled for
disable: process.env.NODE_ENV === "development", // development, letting `next dev` keep running on Turbopack.
}); const withSerwist =
process.env.NODE_ENV === "production"
? require("@serwist/next").default({
swSrc: "src/app/sw.ts",
swDest: "public/sw.js",
disable: process.env.NODE_ENV !== "production",
})
: (config) => config;
module.exports = nextConfig; module.exports = withBundleAnalyzer(withNextIntl(withSerwist(nextConfig)));
module.exports = withBundleAnalyzer(withNextIntl(withPWA({})));
+89 -88
View File
@@ -1,88 +1,89 @@
{ {
"name": "client", "name": "client",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"test": "vitest --config vitetest.config.ts", "test": "vitest --config vitetest.config.ts",
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build --webpack",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "oxlint",
"typeCheck": "tsc -p ./tsconfig.json", "typeCheck": "tsc -p ./tsconfig.json",
"format": "prettier --check \"**/*.{js,jsx,ts,tsx}\"", "postinstall": "patch-package",
"format:fix": "prettier --write \"**/*.{js,jsx,ts,tsx}\"" "format": "oxfmt --check",
}, "format:fix": "oxfmt",
"dependencies": { "knip": "knip",
"@auth/mongodb-adapter": "^3.5.2", "knip:prod": "knip --production",
"@headlessui-float/react": "^0.15.0", "knip:ci": "knip --production --cache"
"@headlessui/react": "^2.1.8", },
"@headlessui/tailwindcss": "^0.2.1", "dependencies": {
"@hookform/resolvers": "^3.9.0", "@auth/mongodb-adapter": "^3.5.2",
"@infra-blocks/zod-utils": "^0.4.2", "@headlessui/react": "^2.1.8",
"@next/bundle-analyzer": "^14.0.4", "@headlessui/tailwindcss": "^0.2.1",
"@socialgouv/matomo-next": "^1.10.0", "@hookform/resolvers": "^3.9.0",
"@tanstack/react-query": "^5.29.0", "@infra-blocks/zod-utils": "^0.4.2",
"@trivago/prettier-plugin-sort-imports": "^4.2.0", "@next/bundle-analyzer": "^16.3.6",
"@turf/boolean-point-in-polygon": "^7.0.0-alpha.114", "@serwist/next": "^9.5.12",
"@types/node": "^22.7.2", "@socialgouv/matomo-next": "^1.10.0",
"autoprefixer": "^10.4.16", "@tanstack/react-query": "^5.29.0",
"class-variance-authority": "^0.7.0", "@turf/boolean-point-in-polygon": "^7.0.0-alpha.114",
"date-fns": "^4.1.0", "@types/node": "^22.7.2",
"geojson": "^0.5.0", "autoprefixer": "^10.4.16",
"jotai": "^2.6.1", "class-variance-authority": "^0.7.0",
"leaflet": "^1.9.4", "date-fns": "^4.1.0",
"leaflet-defaulticon-compatibility": "^0.1.2", "geojson": "^0.5.0",
"leaflet-draw": "^1.0.4", "jotai": "^2.6.1",
"leaflet-gesture-handling": "^1.2.2", "knip": "^6.38.0",
"leaflet.markercluster": "^1.5.3", "leaflet": "^1.9.4",
"leaflet.smooth_marker_bouncing": "3.0.3", "leaflet-defaulticon-compatibility": "^0.1.2",
"lodash": "^4.17.21", "leaflet-draw": "^1.0.4",
"mongodb": "^7.0.0", "leaflet-gesture-handling": "^1.2.2",
"next": "^14.2.3", "leaflet.markercluster": "^1.5.3",
"next-auth": "^5.0.0-beta.16", "leaflet.smooth_marker_bouncing": "3.0.3",
"next-intl": "^3.3.2", "lodash": "^4.17.21",
"next-pwa": "^5.6.0", "mongodb": "^7.0.0",
"next-safe-action": "^7.9.3", "next": "^16.3.6",
"nodemailer": "^6.9.12", "next-auth": "^5.0.0-beta.32",
"postcss": "^8.4.47", "next-intl": "^4.14.7",
"react": "^18.2.0", "next-safe-action": "^7.9.3",
"react-date-range": "^2.0.1", "nodemailer": "^6.9.12",
"react-datepicker": "^7.4.0", "oxfmt": "^0.71.0",
"react-dom": "^18.2.0", "oxlint": "^1.86.0",
"react-hook-form": "^7.46.1", "postcss": "^8.4.47",
"react-icons": "^5.3.0", "react": "^19.3.0",
"react-input-mask": "^2.0.4", "react-date-range": "^2.0.1",
"react-leaflet": "^4.2.1", "react-datepicker": "^7.4.0",
"react-leaflet-cluster": "^2.1.0", "react-dom": "^19.3.0",
"react-leaflet-draw": "^0.20.4", "react-hook-form": "^7.46.1",
"react-select": "^5.7.4", "react-icons": "^5.3.0",
"react-tooltip": "^5.18.0", "react-input-mask": "^2.0.4",
"sharp": "^0.33.0", "react-leaflet": "^4.2.1",
"superjson": "^2.2.1", "react-leaflet-cluster": "^2.1.0",
"tailwind-merge": "^2.0.0", "react-leaflet-draw": "^0.20.4",
"tailwindcss": "^3.3.5", "react-select": "^5.7.4",
"typescript": "^5.3.3", "react-tooltip": "^5.18.0",
"vitest": "^4.0.12", "serwist": "^9.5.12",
"zod": "^3.22.4" "sharp": "^0.33.0",
}, "superjson": "^2.2.1",
"devDependencies": { "tailwind-merge": "^2.0.0",
"@swc-jotai/react-refresh": "^0.2.0", "tailwindcss": "^3.3.5",
"@tailwindcss/forms": "^0.5.4", "typescript": "^5.3.3",
"@tailwindcss/typography": "^0.5.15", "vitest": "^4.0.12",
"@testing-library/jest-dom": "^6.1.2", "zod": "^3.22.4"
"@types/leaflet": "^1.9.12", },
"@types/lodash": "^4.14.195", "devDependencies": {
"@types/nodemailer": "^6.4.8", "@swc-jotai/react-refresh": "^0.2.0",
"@types/react": "^18.2.27", "@tailwindcss/forms": "^0.5.4",
"@types/react-date-range": "^1.4.9", "@tailwindcss/typography": "^0.5.15",
"@types/react-dom": "^18.2.18", "@testing-library/jest-dom": "^6.1.2",
"@types/react-input-mask": "^3.0.2", "@types/leaflet": "^1.9.12",
"eslint": "8", "@types/lodash": "^4.14.195",
"eslint-config-next": "^14.0.4", "@types/nodemailer": "^6.4.8",
"eslint-config-prettier": "^9.0.0", "@types/react": "^19.3.0",
"eslint-plugin-react-hooks": "^5.0.0-canary-7118f5dd7-20230705", "@types/react-date-range": "^1.4.9",
"prettier": "^3.1.1", "@types/react-dom": "^19.3.0",
"prettier-plugin-tailwindcss": "^0.6.8" "@types/react-input-mask": "^3.0.2",
}, "patch-package": "^8.0.1"
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610" },
} "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
}
+19
View File
@@ -0,0 +1,19 @@
diff --git a/node_modules/react-leaflet-cluster/lib/index.js b/node_modules/react-leaflet-cluster/lib/index.js
index 36ab0c1..ba2ae92 100644
--- a/node_modules/react-leaflet-cluster/lib/index.js
+++ b/node_modules/react-leaflet-cluster/lib/index.js
@@ -28,14 +28,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@react-leaflet/core");
var leaflet_1 = __importDefault(require("leaflet"));
require("leaflet.markercluster");
-require("./assets/MarkerCluster.css");
-require("./assets/MarkerCluster.Default.css");
-delete leaflet_1.default.Icon.Default.prototype._getIconUrl;
-leaflet_1.default.Icon.Default.mergeOptions({
- iconRetinaUrl: require('./assets/marker-icon-2x.png').default,
- iconUrl: require('./assets/marker-icon.png').default,
- shadowUrl: require('./assets/marker-shadow.png').default,
-});
function getPropsAndEvents(props) {
var clusterProps = {};
var clusterEvents = {};
-1
View File
@@ -1 +0,0 @@
self.__WB_DISABLE_DEV_LOGS=!0;
@@ -4,10 +4,11 @@ import SignInClient from "@/app/[locale]/(main)/auth/sign-in/SignInClient";
import { baseUrl } from "@/constants"; import { baseUrl } from "@/constants";
export async function generateMetadata({ export async function generateMetadata({
params: { locale }, params,
}: { }: {
params: { locale?: string }; params: Promise<{ locale?: string }>;
}): Promise<Metadata> { }): Promise<Metadata> {
const { locale } = await params;
return { return {
alternates: { alternates: {
canonical: canonical:
+3 -2
View File
@@ -12,10 +12,11 @@ import ClubsDisplay from "./ClubsDisplay";
export const revalidate = 3600; // Revalidate cache every 6 hours export const revalidate = 3600; // Revalidate cache every 6 hours
export async function generateMetadata({ export async function generateMetadata({
params: { locale }, params,
}: { }: {
params: { locale?: string }; params: Promise<{ locale?: string }>;
}): Promise<Metadata> { }): Promise<Metadata> {
const { locale } = await params;
return { return {
alternates: { alternates: {
canonical: canonical:
+3 -2
View File
@@ -4,10 +4,11 @@ import EloClient from "@/app/[locale]/(main)/elo/EloClient";
import { baseUrl } from "@/constants"; import { baseUrl } from "@/constants";
export async function generateMetadata({ export async function generateMetadata({
params: { locale }, params,
}: { }: {
params: { locale?: string }; params: Promise<{ locale?: string }>;
}): Promise<Metadata> { }): Promise<Metadata> {
const { locale } = await params;
return { return {
alternates: { alternates: {
canonical: canonical:
@@ -3,7 +3,7 @@
import { useCallback, useMemo } from "react"; import { useCallback, useMemo } from "react";
import { useAtomValue } from "jotai"; import { useAtomValue } from "jotai";
import L, { LatLngLiteral } from "leaflet"; import L from "leaflet";
import "leaflet-defaulticon-compatibility"; import "leaflet-defaulticon-compatibility";
import "leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.css"; import "leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.css";
import "leaflet.smooth_marker_bouncing"; import "leaflet.smooth_marker_bouncing";
+3 -2
View File
@@ -20,10 +20,11 @@ import TournamentsDisplay from "./TournamentsDisplay";
setDefaultOptions({ locale: fr }); setDefaultOptions({ locale: fr });
export async function generateMetadata({ export async function generateMetadata({
params: { locale }, params,
}: { }: {
params: { locale?: string }; params: Promise<{ locale?: string }>;
}): Promise<Metadata> { }): Promise<Metadata> {
const { locale } = await params;
return { return {
alternates: { alternates: {
canonical: canonical:

Before

Width:  |  Height:  |  Size: 197 KiB

After

Width:  |  Height:  |  Size: 197 KiB

+6 -4
View File
@@ -21,12 +21,13 @@ const title = Julius_Sans_One({
}); });
export async function generateMetadata({ export async function generateMetadata({
params: { locale }, params,
}: { }: {
params: { locale?: string }; params: Promise<{ locale?: string }>;
}) { }) {
// While the `locale` is required, the namespace is optional and // While the `locale` is required, the namespace is optional and
// identical to the parameter that `useTranslations` accepts. // identical to the parameter that `useTranslations` accepts.
const { locale } = await params;
const t = await getTranslations({ const t = await getTranslations({
locale: locale ?? "fr", locale: locale ?? "fr",
namespace: "Metadata", namespace: "Metadata",
@@ -48,11 +49,12 @@ export async function generateMetadata({
export default async function RootLayout({ export default async function RootLayout({
children, children,
params: { locale }, params,
}: { }: {
children: ReactNode; children: ReactNode;
params: { locale?: string }; params: Promise<{ locale?: string }>;
}) { }) {
const { locale } = await params;
let messages; let messages;
try { try {
messages = (await import(`@/messages/${locale}.json`)).default; messages = (await import(`@/messages/${locale}.json`)).default;
+1 -1
View File
@@ -5,7 +5,7 @@ import { GrLineChart } from "react-icons/gr";
import { HiUserGroup } from "react-icons/hi2"; import { HiUserGroup } from "react-icons/hi2";
import { twMerge } from "tailwind-merge"; import { twMerge } from "tailwind-merge";
import bannerImage from "/public/banner.jpeg"; import bannerImage from "./banner.jpeg";
import { Link } from "@/utils/routing"; import { Link } from "@/utils/routing";
export default function Home() { export default function Home() {
+21
View File
@@ -0,0 +1,21 @@
import { defaultCache } from "@serwist/next/worker";
import type { PrecacheEntry } from "serwist";
import { Serwist } from "serwist";
declare global {
interface WorkerGlobalScope {
__SW_MANIFEST: (PrecacheEntry | string)[] | undefined;
}
}
declare const self: WorkerGlobalScope;
const serwist = new Serwist({
precacheEntries: self.__SW_MANIFEST,
skipWaiting: true,
clientsClaim: true,
navigationPreload: true,
runtimeCaching: defaultCache,
});
serwist.addEventListeners();
+33 -41
View File
@@ -1,6 +1,5 @@
import React from "react"; import React from "react";
import { Float } from "@headlessui-float/react";
import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/react"; import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/react";
import { IoMdMore } from "react-icons/io"; import { IoMdMore } from "react-icons/io";
import { twMerge } from "tailwind-merge"; import { twMerge } from "tailwind-merge";
@@ -25,47 +24,40 @@ export const DropdownMenu = ({
}: DropdownMenuProps) => { }: DropdownMenuProps) => {
return ( return (
<Menu as="div" className={twMerge("relative", containerClassName)}> <Menu as="div" className={twMerge("relative", containerClassName)}>
<Float {buttonComponent ?? (
portal <MenuButton>
placement="bottom-end" <IoMdMore />
offset={15} </MenuButton>
enter="transition ease-out duration-100" )}
enterFrom="transform opacity-0 scale-95"
enterTo="transform opacity-100 scale-100"
leave="transition ease-in duration-75"
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
>
{buttonComponent ?? (
<MenuButton>
<IoMdMore />
</MenuButton>
)}
<MenuItems className="z-20 flex w-auto items-start overflow-hidden rounded-md bg-neutral-200 focus:outline-none dark:bg-neutral-600"> <MenuItems
<div className="flex flex-col px-1 py-1"> anchor={{ to: "bottom end", gap: 15 }}
{items.map(({ title, onClick, className, disabled }, i) => ( portal
<MenuItem key={i}> transition
<button className="z-20 flex w-auto items-start overflow-hidden rounded-md bg-neutral-200 transition ease-out data-[closed]:scale-95 data-[closed]:opacity-0 focus:outline-none dark:bg-neutral-600"
type="button" >
className={twMerge( <div className="flex flex-col px-1 py-1">
"w-full whitespace-nowrap rounded-md px-2.5 py-2 text-left text-sm text-black dark:text-white", {items.map(({ title, onClick, className, disabled }, i) => (
!disabled && "hover:bg-white dark:hover:bg-neutral-700", <MenuItem key={i}>
disabled && "text-neutral-500 dark:text-neutral-500", <button
className, type="button"
)} className={twMerge(
disabled={disabled ?? false} "w-full whitespace-nowrap rounded-md px-2.5 py-2 text-left text-sm text-black dark:text-white",
onClick={() => { !disabled && "hover:bg-white dark:hover:bg-neutral-700",
if (!disabled) onClick(); disabled && "text-neutral-500 dark:text-neutral-500",
}} className,
> )}
{title} disabled={disabled ?? false}
</button> onClick={() => {
</MenuItem> if (!disabled) onClick();
))} }}
</div> >
</MenuItems> {title}
</Float> </button>
</MenuItem>
))}
</div>
</MenuItems>
</Menu> </Menu>
); );
}; };
+12 -5
View File
@@ -12,6 +12,8 @@ import "leaflet/dist/leaflet.css";
import { FaAngleDoubleDown } from "react-icons/fa"; import { FaAngleDoubleDown } from "react-icons/fa";
import { LayerGroup, MapContainer, TileLayer } from "react-leaflet"; import { LayerGroup, MapContainer, TileLayer } from "react-leaflet";
import MarkerClusterGroup from "react-leaflet-cluster"; import MarkerClusterGroup from "react-leaflet-cluster";
import "react-leaflet-cluster/lib/assets/MarkerCluster.css";
import "react-leaflet-cluster/lib/assets/MarkerCluster.Default.css";
import { debouncedHoveredListIdAtom, mapBoundsAtom } from "@/atoms"; import { debouncedHoveredListIdAtom, mapBoundsAtom } from "@/atoms";
import { MapEvents } from "@/components/MapEvents"; import { MapEvents } from "@/components/MapEvents";
@@ -60,7 +62,7 @@ type MapProps = {
export const Map = ({ export const Map = ({
filters, filters,
legend, legend,
markers: markers, markers,
iconCreateFunction, iconCreateFunction,
}: MapProps) => { }: MapProps) => {
const setMapBounds = useSetAtom(mapBoundsAtom); const setMapBounds = useSetAtom(mapBoundsAtom);
@@ -193,11 +195,16 @@ export const Map = ({
const referencedMarkers = useMemo( const referencedMarkers = useMemo(
() => () =>
markers.map((marker) => markers.map((marker) =>
React.cloneElement(marker.component, { React.cloneElement(
ref: (ref: MarkerRef) => { marker.component as React.ReactElement<{
markerRefs.current[marker.markerId] = ref; ref?: (ref: MarkerRef) => void;
}>,
{
ref: (ref: MarkerRef) => {
markerRefs.current[marker.markerId] = ref;
},
}, },
}), ),
), ),
[markers], [markers],
); );
+9 -6
View File
@@ -1,23 +1,26 @@
"use client"; "use client";
import { useEffect } from "react";
import { trackAppRouter } from "@socialgouv/matomo-next"; import { trackAppRouter } from "@socialgouv/matomo-next";
import { usePathname, useSearchParams } from "next/navigation"; import { usePathname, useSearchParams } from "next/navigation";
import { useEffect } from "react";
const MATOMO_URL = process.env.NEXT_PUBLIC_MATOMO_URL; const MATOMO_URL = process.env.NEXT_PUBLIC_MATOMO_URL;
const MATOMO_SITE_ID = process.env.NEXT_PUBLIC_MATOMO_SITE_ID; const MATOMO_SITE_ID = process.env.NEXT_PUBLIC_MATOMO_SITE_ID;
const isMatomoEnabled = Boolean(MATOMO_URL && MATOMO_SITE_ID);
export function MatomoAnalytics() { export function MatomoAnalytics() {
const pathname = usePathname(); const pathname = usePathname();
const searchParams = useSearchParams(); const searchParams = useSearchParams();
useEffect(() => { useEffect(() => {
if (!isMatomoEnabled) return;
trackAppRouter({ trackAppRouter({
url: MATOMO_URL || "", url: MATOMO_URL as string,
siteId: MATOMO_SITE_ID || "", siteId: MATOMO_SITE_ID as string,
pathname, pathname,
searchParams, // Pass URLSearchParams object directly searchParams,
// Optional: Enable additional features
enableHeatmapSessionRecording: false, enableHeatmapSessionRecording: false,
enableHeartBeatTimer: true, enableHeartBeatTimer: true,
cleanUrl: true, cleanUrl: true,
@@ -27,4 +30,4 @@ export function MatomoAnalytics() {
}, [pathname, searchParams]); }, [pathname, searchParams]);
return null; return null;
} }
+1 -1
View File
@@ -17,7 +17,7 @@ import { Field, GenericFieldProps } from "./Field";
export type BaseOption<T = string, D = unknown> = { export type BaseOption<T = string, D = unknown> = {
value: T; value: T;
label: string | JSX.Element; label: string | React.JSX.Element;
disabled?: boolean; disabled?: boolean;
data?: D; data?: D;
}; };
+1 -1
View File
@@ -8,7 +8,7 @@ import { Prettify } from "@/types";
export type BaseOption<T = string, D = unknown> = { export type BaseOption<T = string, D = unknown> = {
value: T; value: T;
label: string | JSX.Element; label: string | React.JSX.Element;
disabled?: boolean; disabled?: boolean;
data?: D; data?: D;
}; };
@@ -91,7 +91,7 @@ export const TournamentSelectField = <
background: `${TimeControlColours[option.data!.timeControl]}`, background: `${TimeControlColours[option.data!.timeControl]}`,
}} }}
> >
{at("timeControlEnum", { tc: option.data?.timeControl })} {at("timeControlEnum", { tc: option.data!.timeControl })}
</div> </div>
<div className="text-xs">{option.data?.date}</div> <div className="text-xs">{option.data?.date}</div>
</div> </div>
+1 -1
View File
@@ -20,7 +20,7 @@ export type ZoneEditorProps = {
export const ZoneEditor = ({ value, onChange }: ZoneEditorProps) => { export const ZoneEditor = ({ value, onChange }: ZoneEditorProps) => {
const initialFeatures = React.useRef(value?.features); const initialFeatures = React.useRef(value?.features);
const featureGroup = React.useRef<L.FeatureGroup>(); const featureGroup = React.useRef<L.FeatureGroup | null>(null);
const setFeatureCollectionRef = (element: L.FeatureGroup) => { const setFeatureCollectionRef = (element: L.FeatureGroup) => {
featureGroup.current = element; featureGroup.current = element;
+1 -1
View File
@@ -6,7 +6,7 @@ const useDatePickerWidth = ({
datePickerRef, datePickerRef,
setDateDirectionState, setDateDirectionState,
}: { }: {
datePickerRef: RefObject<HTMLDivElement>; datePickerRef: RefObject<HTMLDivElement | null>;
setDateDirectionState: Dispatch<SetStateAction<DatePickerDirection>>; setDateDirectionState: Dispatch<SetStateAction<DatePickerDirection>>;
}) => { }) => {
useEffect(() => { useEffect(() => {
+5 -3
View File
@@ -3,11 +3,13 @@ import { notFound } from "next/navigation";
import { routing } from "./utils/routing"; import { routing } from "./utils/routing";
export default getRequestConfig(async ({ locale }) => { export default getRequestConfig(async ({ requestLocale }) => {
// Validate that the incoming `locale` parameter is valid // Validate that the incoming `locale` parameter is valid
if (!routing.locales.includes(locale as any)) notFound(); const locale = await requestLocale;
if (!locale || !routing.locales.includes(locale as any)) notFound();
return { return {
locale,
messages: ( messages: (
await (locale === "en" await (locale === "en"
? // When using Turbopack, this will enable HMR for `en` ? // When using Turbopack, this will enable HMR for `en`
@@ -15,4 +17,4 @@ export default getRequestConfig(async ({ locale }) => {
: import(`./messages/${locale}.json`)) : import(`./messages/${locale}.json`))
).default, ).default,
}; };
}); });
View File
-2
View File
@@ -1,7 +1,5 @@
"use server"; "use server";
import { z } from "zod";
import { contactUsSchema } from "@/schemas"; import { contactUsSchema } from "@/schemas";
import { errorLog } from "@/utils/logger"; import { errorLog } from "@/utils/logger";
-1
View File
@@ -1,7 +1,6 @@
"use server"; "use server";
import { ObjectId } from "mongodb"; import { ObjectId } from "mongodb";
import { z } from "zod";
import { adapter, auth } from "@/auth"; import { adapter, auth } from "@/auth";
import { collections, dbConnect } from "@/server/mongodb"; import { collections, dbConnect } from "@/server/mongodb";
+1 -1
View File
@@ -80,5 +80,5 @@ export function generatePieSVG(
return [...prev, [to, path(getDAttribute(radius, from, to), value.colour)]]; return [...prev, [to, path(getDAttribute(radius, from, to), value.colour)]];
}, []); }, []);
return svg(className, radius * 2, paths.map(([to, path]) => path).join("")); return svg(className, radius * 2, paths.map(([_to, path]) => path).join(""));
} }
+2 -2
View File
@@ -1,4 +1,4 @@
import { createLocalizedPathnamesNavigation } from "next-intl/navigation"; import { createNavigation } from "next-intl/navigation";
import { defineRouting } from "next-intl/routing"; import { defineRouting } from "next-intl/routing";
export const routing = defineRouting({ export const routing = defineRouting({
@@ -62,4 +62,4 @@ export type Pathnames = keyof typeof routing.pathnames;
export type Locale = (typeof routing.locales)[number]; export type Locale = (typeof routing.locales)[number];
export const { Link, redirect, usePathname, useRouter, getPathname } = export const { Link, redirect, usePathname, useRouter, getPathname } =
createLocalizedPathnamesNavigation(routing); createNavigation(routing);
+14 -5
View File
@@ -1,7 +1,11 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"lib": ["dom", "dom.iterable", "esnext"], "lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
@@ -12,7 +16,7 @@
"moduleResolution": "bundler", "moduleResolution": "bundler",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve", "jsx": "react-jsx",
"incremental": true, "incremental": true,
"plugins": [ "plugins": [
{ {
@@ -20,7 +24,9 @@
} }
], ],
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": [
"./src/*"
]
} }
}, },
"include": [ "include": [
@@ -30,7 +36,10 @@
".next/types/**/*.ts", ".next/types/**/*.ts",
"global.d.ts", "global.d.ts",
"leaflet.d.ts", "leaflet.d.ts",
"next-auth.d.ts" "next-auth.d.ts",
".next/dev/types/**/*.ts"
], ],
"exclude": ["node_modules"] "exclude": [
"node_modules"
]
} }
-5
View File
@@ -1,5 +0,0 @@
// To disable all workbox logging during development, you can set self.__WB_DISABLE_DEV_LOGS to true
// https://developers.google.com/web/tools/workbox/guides/configure-workbox#disable_logging
// eslint-disable-next-line no-underscore-dangle,no-restricted-globals
self.__WB_DISABLE_DEV_LOGS = true;
+2407 -5245
View File
File diff suppressed because it is too large Load Diff