Open marijana-fi opened 10 months ago
0b1dbe3252
)[!TIP] I can email you next time I complete a pull request if you set up your email here!
Here are the GitHub Actions logs prior to making any changes:
13d816b
Checking src/App.js for syntax errors... ✅ src/App.js has no syntax errors!
1/1 ✓Checking src/App.js for syntax errors... ✅ src/App.js has no syntax errors!
Sandbox passed on the latest master
, so sandbox checks will be enabled for this issue.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
src/App.js
✓ https://github.com/marijana-fi/store-locator-mapbox/commit/96069caeee1efc8c3947a7fc4259369d3e09e59d Edit
Modify src/App.js with contents: Change the height property of the viewport state from "100vh" to "50vh" when the window's innerWidth is less than 480. This will ensure that the map takes up 50% of the screen height on mobile devices. The modified code should look like this:
const [viewport, setViewport] = useState({
latitude: 49.0555,
longitude: 10.4376,
zoom: window.innerWidth < 480 ? 3 : 3.5,
width: window.innerWidth < 480 ? "100vw" : "50vw",
height: window.innerWidth < 480 ? "50vh" : "100vh"
});
--- +++ @@ -20,7 +20,7 @@ longitude: 10.4376, zoom: window.innerWidth < 480 ? 3 : 3.5, width: window.innerWidth < 480 ? "100vw" : "50vw", - height: window.innerWidth < 480 ? "50vh" : "100vh" + height: window.innerWidth < 480 ? "50vh" : "50vh" }); const [selected, setSelected] = useState(null); const [open, setOpen] = useState(false);
src/App.js
✓ Edit
Check src/App.js with contents:
Ran GitHub Actions for 96069caeee1efc8c3947a7fc4259369d3e09e59d:
src/App.js
✓ https://github.com/marijana-fi/store-locator-mapbox/commit/f19abdff31968a52cd963131dbb25a49f8699903 Edit
Modify src/App.js with contents: Change the height property of the viewport object in the goToViewport function from "100vh" to "50vh" when the window's innerWidth is less than 480. This will ensure that the map takes up 50% of the screen height on mobile devices when the viewport is changed. The modified code should look like this:
const goToViewport = (latitude, longitude) => {
onViewportChange({
latitude,
longitude,
zoom: window.innerWidth < 480 ? 5 : 6,
width: window.innerWidth < 480 ? "100vw" : "50vw",
height: window.innerWidth < 480 ? "50vh" : "100vh",
transitionInterpolator: new FlyToInterpolator({ speed: 1.2 }),
transitionDuration: "auto"
});
};
--- +++ @@ -20,7 +20,7 @@ longitude: 10.4376, zoom: window.innerWidth < 480 ? 3 : 3.5, width: window.innerWidth < 480 ? "100vw" : "50vw", - height: window.innerWidth < 480 ? "50vh" : "100vh" + height: window.innerWidth < 480 ? "50vh" : "50vh" }); const [selected, setSelected] = useState(null); const [open, setOpen] = useState(false); @@ -51,7 +51,7 @@ longitude, zoom: window.innerWidth < 480 ? 5 : 6, width: window.innerWidth < 480 ? "100vw" : "50vw", - height: window.innerWidth < 480 ? "50vh" : "100vh", + height: window.innerWidth < 480 ? "50vh" : "50vh", transitionInterpolator: new FlyToInterpolator({ speed: 1.2 }), transitionDuration: "auto" });
src/App.js
✓ Edit
Check src/App.js with contents:
Ran GitHub Actions for f19abdff31968a52cd963131dbb25a49f8699903:
I have finished reviewing the code for completeness. I did not find errors for sweep/make_map_section_50vh_high_on_mobile
.
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord
The map section in the page layout should expand on mobile to 50% of the screen height.
Checklist
- [X] Modify `src/App.js` ✓ https://github.com/marijana-fi/store-locator-mapbox/commit/96069caeee1efc8c3947a7fc4259369d3e09e59d [Edit](https://github.com/marijana-fi/store-locator-mapbox/edit/sweep/make_map_section_50vh_high_on_mobile/src/App.js#L18-L23) - [X] Running GitHub Actions for `src/App.js` ✓ [Edit](https://github.com/marijana-fi/store-locator-mapbox/edit/sweep/make_map_section_50vh_high_on_mobile/src/App.js#L18-L23) - [X] Modify `src/App.js` ✓ https://github.com/marijana-fi/store-locator-mapbox/commit/f19abdff31968a52cd963131dbb25a49f8699903 [Edit](https://github.com/marijana-fi/store-locator-mapbox/edit/sweep/make_map_section_50vh_high_on_mobile/src/App.js#L48-L54) - [X] Running GitHub Actions for `src/App.js` ✓ [Edit](https://github.com/marijana-fi/store-locator-mapbox/edit/sweep/make_map_section_50vh_high_on_mobile/src/App.js#L48-L54)