Skip to content

Commit

Permalink
fix: remove node.js code from browser context (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoamGaash authored Oct 3, 2023
1 parent 32b5792 commit 5968cb3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/pages/RealtimeMapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface Path {
}

export const colorIcon = ({ operator_id, name }: { operator_id: string; name?: string }) => {
const path = process.env.PUBLIC_URL + `/bus-logos/${operator_id}.svg`
const path = `/bus-logos/${operator_id}.svg`
return new DivIcon({
className: 'my-div-icon',
html: `
Expand Down Expand Up @@ -245,7 +245,6 @@ export function Markers({ positions }: { positions: Point[] }) {
map.flyTo([position.coords.latitude, position.coords.longitude], 13),
)
}, [])
// const two = process.env.PUBLIC_URL + '/bus-groups/2.svg'

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/components/MapLayers/BusLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { VehicleLocation } from 'src/model/vehicleLocation'
import createClusterCustomIcon from '../utils/customCluster/customCluster'

const colorIcon = ({ operator_id, name }: { operator_id: string; name?: string }) => {
const path = process.env.PUBLIC_URL + `/bus-logos/${operator_id}.svg`
const path = `/bus-logos/${operator_id}.svg`
return new DivIcon({
className: 'my-div-icon',
html: `
Expand Down
2 changes: 1 addition & 1 deletion src/pages/components/utils/customCluster/customCluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default createClusterCustomIcon
const getIconForGroup = (numOfNearbyBusses: number): string => {
const groupSizes = [30, 10, 3, 2]

const imgPath = process.env.PUBLIC_URL + '/bus-groups/'
const imgPath = '/bus-groups/'
const iconName = `${groupSizes.find((groupSize) => numOfNearbyBusses >= groupSize) || 3}.svg`
return imgPath + iconName
}
Expand Down

0 comments on commit 5968cb3

Please sign in to comment.