Skip to content

Commit

Permalink
refactor: Rename <LocationMarker /> to <LocationSearchMarker />
Browse files Browse the repository at this point in the history
  • Loading branch information
joshlarson committed Nov 20, 2023
1 parent 976faef commit 29dc8f3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ import { LocationSearchResult } from "../../../models/locationSearchResult"
import { LocationDotIcon } from "../../../helpers/icon"
import Leaflet from "leaflet"

export const LocationMarkerIcon = ({ selected }: { selected?: boolean }) => (
export const LocationSearchMarkerIcon = ({
selected,
}: {
selected?: boolean
}) => (
<LocationDotIcon
className={
"c-location-dot-icon" + (selected ? " c-location-dot-icon--selected" : "")
}
/>
)

export const LocationMarker = ({
export const LocationSearchMarker = ({
location,
selected,
}: {
Expand All @@ -26,6 +30,6 @@ export const LocationMarker = ({
iconSize: [24, 18],
className: "",
}}
icon={<LocationMarkerIcon selected={selected} />}
icon={<LocationSearchMarkerIcon selected={selected} />}
/>
)
4 changes: 2 additions & 2 deletions assets/src/components/mapPage/mapDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
VehicleMarker,
} from "../mapMarkers"
import { MapSafeAreaContext } from "../../contexts/mapSafeAreaContext"
import { LocationMarker } from "../map/markers/locationMarker"
import { LocationSearchMarker } from "../map/markers/locationSearchMarker"
import ZoomLevelWrapper from "../ZoomLevelWrapper"
import StreetViewModeEnabledContext from "../../contexts/streetViewModeEnabledContext"
import { streetViewUrl } from "../../util/streetViewUrl"
Expand Down Expand Up @@ -395,7 +395,7 @@ const SelectedLocationDataLayer = ({

return (
<>
<LocationMarker location={location} selected={true} />
<LocationSearchMarker location={location} selected={true} />
<RecenterControlWithInterruptibleFollower
onUpdate={fixedZoomDrawerOffsetAutoCenter}
positions={[Leaflet.latLng(location.latitude, location.longitude)]}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Meta, StoryObj } from "@storybook/react"
import {
LocationMarkerIcon,
LocationMarker,
} from "../../../../src/components/map/markers/locationMarker"
LocationSearchMarkerIcon,
LocationSearchMarker,
} from "../../../../src/components/map/markers/locationSearchMarker"
import { inMapDecorator } from "../../../../.storybook/inMapDecorator"
import locationSearchResultFactory from "../../../../tests/factories/locationSearchResult"

Expand All @@ -16,13 +16,13 @@ const meta = {
argTypes: {
location: { table: { disable: true } },
},
render: LocationMarkerIcon,
component: LocationMarker,
render: LocationSearchMarkerIcon,
component: LocationSearchMarker,
parameters: {
layout: "centered",
stretch: false,
},
} satisfies Meta<typeof LocationMarker>
} satisfies Meta<typeof LocationSearchMarker>

export default meta
type Story = StoryObj<typeof meta>
Expand All @@ -41,7 +41,7 @@ export const Selected: Story = {

const InMap: Story = {
decorators: [inMapDecorator],
render: LocationMarker,
render: LocationSearchMarker,
parameters: {
layout: "fullscreen",
stretch: true,
Expand Down

0 comments on commit 29dc8f3

Please sign in to comment.