mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-11-18 07:22:06 +00:00
Update packages
This commit is contained in:
@@ -42,7 +42,7 @@ export const DropdownMenu = ({
|
||||
</Menu.Button>
|
||||
)}
|
||||
|
||||
<Menu.Items className="z-20 flex w-auto items-start overflow-hidden rounded-md bg-neutral-200 focus:outline-none dark:bg-neutral-600">
|
||||
<Menu.Items className="z-20 flex w-auto items-start overflow-hidden rounded-md bg-neutral-200 focus:outline-none dark:bg-neutral-600">
|
||||
<div className="flex flex-col px-1 py-1">
|
||||
{items.map(({ title, onClick, className, disabled }, i) => (
|
||||
<Menu.Item key={i}>
|
||||
|
||||
@@ -4,12 +4,7 @@ import { useCallback, useEffect, useMemo, useRef } from "react";
|
||||
import React from "react";
|
||||
|
||||
import { useAtomValue, useSetAtom } from "jotai";
|
||||
import L, {
|
||||
DomUtil,
|
||||
LatLngLiteral,
|
||||
Marker,
|
||||
MarkerClusterGroupOptions,
|
||||
} from "leaflet";
|
||||
import L, { DomUtil, LatLngLiteral, Marker } from "leaflet";
|
||||
import "leaflet-defaulticon-compatibility";
|
||||
import "leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.css";
|
||||
import "leaflet.smooth_marker_bouncing";
|
||||
@@ -70,7 +65,7 @@ type MapProps = {
|
||||
filters?: React.ReactNode;
|
||||
legend?: React.ReactNode;
|
||||
markers: MapMarker[];
|
||||
iconCreateFunction?: MarkerClusterGroupOptions["iconCreateFunction"];
|
||||
iconCreateFunction?: L.MarkerClusterGroupOptions["iconCreateFunction"];
|
||||
};
|
||||
|
||||
export const Map = ({
|
||||
|
||||
@@ -79,8 +79,8 @@ export const RegionSelect = ({
|
||||
};
|
||||
|
||||
const formatGroupLabel = (data: GroupedOption) => (
|
||||
<div className="relative -translate-y-1/2 border-b-2 border-primary-500 text-xs font-bold uppercase text-primary-500 ">
|
||||
<div className="relative top-1/2 inline-block translate-y-1/2 bg-gray-50 pr-2 dark:bg-gray-700 ">
|
||||
<div className="relative -translate-y-1/2 border-b-2 border-primary-500 text-xs font-bold uppercase text-primary-500">
|
||||
<div className="relative top-1/2 inline-block translate-y-1/2 bg-gray-50 pr-2 dark:bg-gray-700">
|
||||
{data.label}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -55,7 +55,7 @@ const SearchBar = ({ className }: SearchBarProps) => {
|
||||
type="search"
|
||||
id="table-search"
|
||||
className={twMerge(
|
||||
"block rounded-lg border border-gray-300 bg-gray-50 p-2.5 px-10 text-sm text-gray-900 focus:border-primary-500 focus:ring-primary-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-primary-500",
|
||||
"block rounded-lg border border-gray-300 bg-gray-50 p-2.5 px-10 text-sm text-gray-900 focus:border-primary-500 focus:ring-primary-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-500 dark:focus:ring-primary-500",
|
||||
className,
|
||||
)}
|
||||
placeholder={t("searchPlaceholder")}
|
||||
|
||||
@@ -47,7 +47,7 @@ export const SignInForm = ({ callbackPath }: SignInFormProps) => {
|
||||
}
|
||||
});
|
||||
return () => subscription.unsubscribe();
|
||||
}, [form, form.watch]);
|
||||
}, [form, form.watch, responseMessage.message]);
|
||||
|
||||
const onSubmit = async ({ email }: SignInFormValues) => {
|
||||
try {
|
||||
|
||||
@@ -39,7 +39,7 @@ export const InputDatePicker = forwardRef<HTMLInputElement, AllProps>(
|
||||
className={twMerge(
|
||||
"flex w-full content-center rounded-lg border p-3",
|
||||
"border-gray-300 bg-gray-50 text-gray-900 shadow-sm",
|
||||
"dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 ",
|
||||
"dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400",
|
||||
!error &&
|
||||
"focus-within:border-primary-500 focus-within:ring-primary-500 dark:focus-within:border-primary-500 dark:focus-within:ring-primary-500",
|
||||
error && "!border-orange-700 focus:!border-orange-700",
|
||||
|
||||
@@ -78,11 +78,7 @@ export const DateField = <
|
||||
portalId="calendar-portal"
|
||||
dateFormat={dateFormat}
|
||||
disabledKeyboardNavigation={true}
|
||||
formatWeekDay={(day: string) => (
|
||||
<div className="flex h-8 flex-col items-center justify-center">
|
||||
{day.slice(0, 3)}
|
||||
</div>
|
||||
)}
|
||||
formatWeekDay={(day: string) => day.slice(0, 3)}
|
||||
weekDayClassName={() =>
|
||||
"text-xs h-8 w-8 flex-1 bg-gray-50 text-gray-900 dark:bg-gray-700 dark:text-white"
|
||||
}
|
||||
@@ -95,9 +91,13 @@ export const DateField = <
|
||||
onChange={field.onChange}
|
||||
onChangeRaw={(e) => {
|
||||
// Called when the user types in the input
|
||||
if (e.currentTarget.value) {
|
||||
if (e?.currentTarget && "value" in e.currentTarget) {
|
||||
const value = e.currentTarget.value;
|
||||
const date = parse(value, at("dateParseFormat"), new Date());
|
||||
const date = parse(
|
||||
value as string,
|
||||
at("dateParseFormat"),
|
||||
new Date(),
|
||||
);
|
||||
if (
|
||||
isValid(date) &&
|
||||
date.getFullYear() >= min &&
|
||||
|
||||
@@ -92,7 +92,7 @@ export const RadioGroupField = <
|
||||
value={option.value}
|
||||
className={({ checked }) =>
|
||||
twMerge(
|
||||
"flex flex-1 cursor-pointer items-center justify-center rounded-lg border px-5 py-3 text-center font-medium focus:outline-none",
|
||||
"flex flex-1 cursor-pointer items-center justify-center rounded-lg border px-5 py-3 text-center font-medium focus:outline-none",
|
||||
"border-gray-300 bg-gray-50 text-gray-900",
|
||||
"dark:border-gray-600 dark:bg-gray-700 dark:text-white",
|
||||
checked &&
|
||||
|
||||
@@ -42,7 +42,7 @@ export const classNames = <Option, IsMulti extends boolean = false>(
|
||||
menu: () =>
|
||||
twMerge(
|
||||
"!z-30 mt-2 rounded-lg border border-gray-200 bg-white p-1",
|
||||
"border-gray-300 bg-gray-50 text-gray-900",
|
||||
"border-gray-300 bg-gray-50 text-gray-900",
|
||||
"dark:border-gray-600 dark:bg-gray-700 dark:text-white",
|
||||
),
|
||||
groupHeading: () => "mx-3 mt-2 mb-1 text-textGray text-sm uppercase",
|
||||
|
||||
@@ -87,7 +87,7 @@ export const TextAreaField = <
|
||||
disabled={disabled}
|
||||
className={twMerge(
|
||||
"flex w-full content-center rounded-lg border p-3",
|
||||
"border-gray-300 bg-gray-50 text-gray-900 shadow-sm focus:border-primary-500 focus:ring-primary-500",
|
||||
"border-gray-300 bg-gray-50 text-gray-900 shadow-sm focus:border-primary-500 focus:ring-primary-500",
|
||||
"dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-primary-500 dark:focus:ring-primary-500",
|
||||
hasError && "!border-orange-700 focus:!border-orange-700",
|
||||
disabled && "dark:bg-gray-50",
|
||||
|
||||
@@ -60,7 +60,7 @@ export const TextField = <
|
||||
? isNaN(value)
|
||||
? ""
|
||||
: value.toString()
|
||||
: value ?? "";
|
||||
: (value ?? "");
|
||||
};
|
||||
|
||||
const output =
|
||||
|
||||
@@ -40,7 +40,8 @@ export const TournamentSelectField = <
|
||||
useState<SearchedTournament | null>(null);
|
||||
|
||||
const loadOption = async (ffeId: string) => {
|
||||
const { data: tournament } = await getTournamentDetails({ ffeId });
|
||||
const result = await getTournamentDetails({ ffeId });
|
||||
const tournament = result?.data;
|
||||
|
||||
return !tournament
|
||||
? undefined
|
||||
@@ -52,10 +53,12 @@ export const TournamentSelectField = <
|
||||
};
|
||||
|
||||
const loadOptions = async (searchValue?: string) => {
|
||||
const { data: tournaments } = await searchTournaments({
|
||||
const result = await searchTournaments({
|
||||
searchValue: searchValue ?? "",
|
||||
});
|
||||
|
||||
const tournaments = result?.data ?? [];
|
||||
|
||||
return (tournaments ?? []).map((tournament) => ({
|
||||
value: tournament.ffeId,
|
||||
label: tournament.tournament,
|
||||
@@ -73,7 +76,7 @@ export const TournamentSelectField = <
|
||||
loadOptions={loadOptions}
|
||||
isClearable={true}
|
||||
onInformChange={(data) => {
|
||||
setSelectedTournament(data ? data[0].data ?? null : null);
|
||||
setSelectedTournament(data ? (data[0].data ?? null) : null);
|
||||
onInformChange?.(data);
|
||||
}}
|
||||
formatOptionLabel={(option, context) => {
|
||||
@@ -83,7 +86,7 @@ export const TournamentSelectField = <
|
||||
<div className="flex items-center gap-2 text-xs uppercase">
|
||||
<div className="flex-1">{option.data?.town}</div>
|
||||
<div
|
||||
className="ml-2 rounded-sm px-1 py-0.5 align-middle text-[9px]/[11px] uppercase text-white"
|
||||
className="ml-2 rounded-sm px-1 py-0.5 align-middle text-[9px]/[11px] uppercase text-white"
|
||||
style={{
|
||||
background: `${TimeControlColours[option.data!.timeControl]}`,
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user