Skip to content

Commit

Permalink
Merge pull request #70 from icssc/61-bug-change-black-marker-to-white…
Browse files Browse the repository at this point in the history
…-in-dark-mode

Changed color of marker to match dark/light mode
  • Loading branch information
NwinNwin authored Jan 20, 2025
2 parents e342bb1 + 7ecbf0e commit c5bf31e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/web/src/assets/logos/others_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/web/src/assets/logos/others_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions packages/web/src/components/Map/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import L from "leaflet";
import "leaflet/dist/leaflet.css";
import Fuse from "fuse.js";

import { othersDrag, flyImg, iconsMap } from "./MapIcons";
import { othersDragBlack, othersDragWhite, flyImg, iconsMap } from "./MapIcons";
import {
MapContainer,
TileLayer,
Expand Down Expand Up @@ -324,7 +324,8 @@ export default function Map({
eventHandlers={eventHandlers}
position={position}
ref={markerRef}
icon={othersDrag}
icon={colorMode == "dark" ? othersDragWhite : othersDragBlack}

>
<Popup minWidth={90} closeButton={false}>
<span className="popup" onClick={() => toggleDraggable()}>
Expand Down
9 changes: 8 additions & 1 deletion packages/web/src/components/Map/MapIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import resolved from "../../assets/logos/resolved.png";
import others_lost from "../../assets/logos/Others_lost.png";
import others_found from "../../assets/logos/Others_found.png";
import others_black from "../../assets/logos/others_black.svg";
import others_white from "../../assets/logos/others_white.svg"

import fly_img from "../../assets/images/fly_img.png";

Expand Down Expand Up @@ -84,12 +85,18 @@ const othersFound = L.icon({
iconAnchor: [25, 40],
});

export const othersDrag = L.icon({
export const othersDragBlack = L.icon({
iconUrl: others_black,
iconSize: [40, 40],
iconAnchor: [25, 25],
});

export const othersDragWhite = L.icon({
iconUrl: others_white,
iconSize: [40, 40],
iconAnchor: [25, 25],
});

export const flyImg = L.icon({
iconUrl: fly_img,
iconSize: [0.01, 0.01],
Expand Down

0 comments on commit c5bf31e

Please sign in to comment.