diff --git a/app/[lang]/tournois/TournamentMap.tsx b/app/[lang]/tournois/TournamentMap.tsx index f4a875a..ccb44b2 100644 --- a/app/[lang]/tournois/TournamentMap.tsx +++ b/app/[lang]/tournois/TournamentMap.tsx @@ -238,10 +238,10 @@ export default function TournamentMap() { const childCount = cluster.getChildCount(); const children = cluster.getAllChildMarkers(); - // We added the time control to the icon options when creating the marker + // We added the time control as the class name when creating the marker const timeControlCounts = countBy( children, - (child: any) => child.options.icon.options.timeControl, + (child: any) => child.options.icon.options.className, ); const html = ` @@ -289,7 +289,6 @@ export default function TournamentMap() { }} key={groupId} tournamentGroup={tournamentGroup} - colour={colours[timeControl]} /> ); }), diff --git a/app/[lang]/tournois/TournamentMarker.tsx b/app/[lang]/tournois/TournamentMarker.tsx index 471d5f2..ab3e1bf 100644 --- a/app/[lang]/tournois/TournamentMarker.tsx +++ b/app/[lang]/tournois/TournamentMarker.tsx @@ -11,6 +11,7 @@ import { last } from "lodash"; import type { BouncingMarker } from "@/leafletTypes"; import { debouncedHoveredMapTournamentGroupIdAtom } from "@/app/atoms"; +import { TimeControlColours } from "@/app/constants"; export type TournamentMarkerRef = { getMarker: () => L.Marker; @@ -19,13 +20,12 @@ export type TournamentMarkerRef = { type TournamentMarkerProps = { tournamentGroup: Tournament[]; - colour: string; } & Omit; export const TournamentMarker = forwardRef< TournamentMarkerRef, TournamentMarkerProps ->(({ tournamentGroup, colour, ...markerProps }, ref) => { +>(({ tournamentGroup, ...markerProps }, ref) => { const t = useTranslations("Tournaments"); const markerRef = useRef | null>(null); @@ -50,15 +50,18 @@ export const TournamentMarker = forwardRef< const iconOptions = useMemo( () => - new L.Icon({ - iconUrl: `/images/leaflet/marker-icon-2x-${colour}.png`, - iconSize: [25, 41], - iconAnchor: [12, 41], - popupAnchor: [1, -34], - - timeControl, + new L.DivIcon({ + html: ` + + + + `, + className: timeControl, + iconSize: [24, 40], + iconAnchor: [12, 40], + popupAnchor: [1, -40], }), - [colour, timeControl], + [timeControl], ); const startDate = date; diff --git a/app/constants.ts b/app/constants.ts index 2a86ce0..4e614c6 100644 --- a/app/constants.ts +++ b/app/constants.ts @@ -3,6 +3,6 @@ import { TimeControl } from "@/types" export const TimeControlColours = { [TimeControl.Classic]: "#00ac39", [TimeControl.Rapid]: "#0086c7", - [TimeControl.Blitz]: "#cec348", - [TimeControl.Other]: "#d10c3e", + [TimeControl.Blitz]: "#ddce20", + [TimeControl.Other]: "#ea5f17", } diff --git a/public/images/leaflet/marker-icon-2x-black.png b/public/images/leaflet/marker-icon-2x-black.png deleted file mode 100644 index 23c94cf..0000000 Binary files a/public/images/leaflet/marker-icon-2x-black.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-2x-blue.png b/public/images/leaflet/marker-icon-2x-blue.png deleted file mode 100644 index 0015b64..0000000 Binary files a/public/images/leaflet/marker-icon-2x-blue.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-2x-gold.png b/public/images/leaflet/marker-icon-2x-gold.png deleted file mode 100644 index 6992d65..0000000 Binary files a/public/images/leaflet/marker-icon-2x-gold.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-2x-green.png b/public/images/leaflet/marker-icon-2x-green.png deleted file mode 100644 index c359abb..0000000 Binary files a/public/images/leaflet/marker-icon-2x-green.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-2x-grey.png b/public/images/leaflet/marker-icon-2x-grey.png deleted file mode 100644 index 43b3eb4..0000000 Binary files a/public/images/leaflet/marker-icon-2x-grey.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-2x-orange.png b/public/images/leaflet/marker-icon-2x-orange.png deleted file mode 100644 index c3c8632..0000000 Binary files a/public/images/leaflet/marker-icon-2x-orange.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-2x-red.png b/public/images/leaflet/marker-icon-2x-red.png deleted file mode 100644 index 1c26e9f..0000000 Binary files a/public/images/leaflet/marker-icon-2x-red.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-2x-violet.png b/public/images/leaflet/marker-icon-2x-violet.png deleted file mode 100644 index ea748aa..0000000 Binary files a/public/images/leaflet/marker-icon-2x-violet.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-2x-yellow.png b/public/images/leaflet/marker-icon-2x-yellow.png deleted file mode 100644 index 8b677d9..0000000 Binary files a/public/images/leaflet/marker-icon-2x-yellow.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-black.png b/public/images/leaflet/marker-icon-black.png deleted file mode 100644 index d262ae4..0000000 Binary files a/public/images/leaflet/marker-icon-black.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-blue.png b/public/images/leaflet/marker-icon-blue.png deleted file mode 100644 index e2e9f75..0000000 Binary files a/public/images/leaflet/marker-icon-blue.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-gold.png b/public/images/leaflet/marker-icon-gold.png deleted file mode 100644 index 162fada..0000000 Binary files a/public/images/leaflet/marker-icon-gold.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-green.png b/public/images/leaflet/marker-icon-green.png deleted file mode 100644 index 56db5ea..0000000 Binary files a/public/images/leaflet/marker-icon-green.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-grey.png b/public/images/leaflet/marker-icon-grey.png deleted file mode 100644 index ebbab8e..0000000 Binary files a/public/images/leaflet/marker-icon-grey.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-orange.png b/public/images/leaflet/marker-icon-orange.png deleted file mode 100644 index fbbce7b..0000000 Binary files a/public/images/leaflet/marker-icon-orange.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-red.png b/public/images/leaflet/marker-icon-red.png deleted file mode 100644 index 3e64e06..0000000 Binary files a/public/images/leaflet/marker-icon-red.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-violet.png b/public/images/leaflet/marker-icon-violet.png deleted file mode 100644 index 28efc3c..0000000 Binary files a/public/images/leaflet/marker-icon-violet.png and /dev/null differ diff --git a/public/images/leaflet/marker-icon-yellow.png b/public/images/leaflet/marker-icon-yellow.png deleted file mode 100644 index b011eea..0000000 Binary files a/public/images/leaflet/marker-icon-yellow.png and /dev/null differ diff --git a/public/images/leaflet/marker-shadow.png b/public/images/leaflet/marker-shadow.png deleted file mode 100644 index 84c5808..0000000 Binary files a/public/images/leaflet/marker-shadow.png and /dev/null differ