mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 04:26:57 +00:00
Merge pull request #117 from TheRealOwenRees/feature/stop-bouce
Stop bouncing when hovering over list item that isn't visible on the map
This commit is contained in:
@@ -111,12 +111,6 @@ export default function TournamentMap() {
|
||||
|
||||
const groupedTournaments = groupBy(filteredTournaments, (t) => t.groupId);
|
||||
|
||||
useEffect(() => {
|
||||
if (hoveredListTournamentId === null) {
|
||||
stopBouncingMarkers();
|
||||
}
|
||||
}, [hoveredListTournamentId]);
|
||||
|
||||
const center: LatLngLiteral = { lat: 47.0844, lng: 2.3964 };
|
||||
|
||||
const onScrollToTable = () => {
|
||||
@@ -129,8 +123,8 @@ export default function TournamentMap() {
|
||||
const tournament = filteredTournaments.find(
|
||||
(t) => t.id === hoveredListTournamentId,
|
||||
);
|
||||
if (!tournament) return false;
|
||||
|
||||
if (tournament) {
|
||||
const markerRef = markerRefs.current[tournament.groupId];
|
||||
if (markerRef) {
|
||||
if (clusterRef.current) {
|
||||
@@ -173,7 +167,9 @@ export default function TournamentMap() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stopBouncingMarkers();
|
||||
return false;
|
||||
}, [filteredTournaments, hoveredListTournamentId]);
|
||||
|
||||
@@ -273,15 +269,7 @@ export default function TournamentMap() {
|
||||
const markers = useMemo(
|
||||
() =>
|
||||
Object.values(groupedTournaments).map((tournamentGroup) => {
|
||||
const { groupId, timeControl } = tournamentGroup[0];
|
||||
|
||||
const colours = {
|
||||
[TimeControl.Classic]: "green",
|
||||
[TimeControl.Rapid]: "blue",
|
||||
[TimeControl.Blitz]: "yellow",
|
||||
[TimeControl.Other]: "red",
|
||||
};
|
||||
|
||||
const { groupId } = tournamentGroup[0];
|
||||
return (
|
||||
<TournamentMarker
|
||||
ref={(ref) => {
|
||||
|
||||
Reference in New Issue
Block a user