Skip to content

Commit

Permalink
Handle tablet view and center red marker
Browse files Browse the repository at this point in the history
  • Loading branch information
hanapotski committed Aug 18, 2024
1 parent 4a90042 commit 1b80bb6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const ResultsMap = ({ stakeholders, categoryIds, toggleCategory, loading }) => {
latitude={startIconCoordinates.latitude}
offsetTop={-50}
offsetLeft={-25}
anchor="bottom"
anchor="center"
>
<StartIcon />
</Marker>
Expand Down Expand Up @@ -218,8 +218,8 @@ const StartIcon = () => {
return (
<svg
viewBox="0 0 90 100"
width="54"
height="74"
width="44"
height="64"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ const MobileLayout = ({ filters, map, list, showList }) => {
let newY;
if (filterPanelOpen) {
newY = 100;
} else if (hasAdvancedFilterFeatureFlag) {
newY = showList ? (100 / window.innerHeight) * 60 : 54;
} else {
newY = showList ? 17 : 54;
}
Expand Down
6 changes: 3 additions & 3 deletions client/src/hooks/useMapbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useMap } from "react-map-gl";
export const useMapbox = () => {
const mapRef = useRef();
const isListPanelOpen = useListPanel();
const { isMobile } = useBreakpoints();
const { isMobile, isDesktop } = useBreakpoints();
const mapbox = useMap();

const getViewport = () => {
Expand All @@ -29,8 +29,8 @@ export const useMapbox = () => {
}
mapbox.default.flyTo({
center: [
isListPanelOpen && !isMobile ? longitude - 0.08 : longitude,
isMobile ? latitude - 0.05 : latitude,
isListPanelOpen && isDesktop ? longitude - 0.08 : longitude,
isMobile ? latitude - 0.04 : latitude,
],
duration: 2000,
});
Expand Down

0 comments on commit 1b80bb6

Please sign in to comment.