Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertical centering on mobile #2219 #2266

Merged
merged 1 commit into from
Nov 1, 2024
Merged

Conversation

whitneywind
Copy link
Member

Fixes #2219

  • This PR updates the useMapbox hook to set the mobile vertical(latitude) offset dynamically according to screen height.

return 0.034 + (screenHeight - baseHeight) * rate;
}

const heightOffsetFactor = !screenHeight
Copy link
Contributor

@hanapotski hanapotski Oct 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good 🙌 just curious why we had to check for screenHeight? would there be a case where window.innerHeight wouldn't exist? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question! In most cases, it should be accessible, so the check isn't strictly necessary. I was just being extra cautious for some rare edge cases, like maybe in an unusual initial load where it returns 0. But for our usage, it's probably safe to assume it’s there!

@entrotech entrotech merged commit 172f412 into develop Nov 1, 2024
@entrotech entrotech deleted the mobile-centering-2219 branch November 1, 2024 01:23
entrotech added a commit that referenced this pull request Nov 20, 2024
* Fix create feature bug

* fix for dynamic vertical centering on mobile (#2266)

* Fix some bugs (#2274)

* Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /client (#2264)

Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md)
- [Commits](chimurai/http-proxy-middleware@v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 2262 feature flag survey and mobile survey (#2269)

* fix feature refetch after add and delete

* Fix user is null when use featureflag

* Update userFeedbacksurvey mobile size

* Undo usefeatureflag hook refech name

* Update App.jsx

Fixed spelling of userFeedbackSurvey

* Fix refresh when add & delete

---------

Co-authored-by: John Darragh <darragh@entrotech.net>

* Update social links (#2279)

* Trigger the fetchMapboxResults function on the leading edge of the wait interval. (#2280)

* Directly install mapbox-gl NPM pkg

* Bumped version number to 1.0.86

* Fix deployment issue, remove validation from social media fields (#2282)

* Bumped version to 1.0.87

* Rebuild package-lock.json files

* Add email and phone input validation (#2284)

* display current location button on mobile (#2283)

* merge vite with develop

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Hannah Zulueta <hannahjoy.zulueta@gmail.com>
Co-authored-by: Whitney Gould <78887901+whitneywind@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: June Zhao <60997220+junjun107@users.noreply.github.com>
Co-authored-by: Farhad Siraj <72041242+farhadsiraj@users.noreply.github.com>
Co-authored-by: Jenna <92393205+JmJenna@users.noreply.github.com>
entrotech added a commit that referenced this pull request Nov 20, 2024
* Fix create feature bug

* fix for dynamic vertical centering on mobile (#2266)

* Fix some bugs (#2274)

* Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /client (#2264)

Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md)
- [Commits](chimurai/http-proxy-middleware@v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 2262 feature flag survey and mobile survey (#2269)

* fix feature refetch after add and delete

* Fix user is null when use featureflag

* Update userFeedbacksurvey mobile size

* Undo usefeatureflag hook refech name

* Update App.jsx

Fixed spelling of userFeedbackSurvey

* Fix refresh when add & delete

---------

Co-authored-by: John Darragh <darragh@entrotech.net>

* Update social links (#2279)

* Trigger the fetchMapboxResults function on the leading edge of the wait interval. (#2280)

* Directly install mapbox-gl NPM pkg

* Bumped version number to 1.0.86

* Fix deployment issue, remove validation from social media fields (#2282)

* Bumped version to 1.0.87

* Rebuild package-lock.json files

* Add email and phone input validation (#2284)

* display current location button on mobile (#2283)

* merge vite with develop

* install @types/node

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Hannah Zulueta <hannahjoy.zulueta@gmail.com>
Co-authored-by: Whitney Gould <78887901+whitneywind@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: June Zhao <60997220+junjun107@users.noreply.github.com>
Co-authored-by: Farhad Siraj <72041242+farhadsiraj@users.noreply.github.com>
Co-authored-by: Jenna <92393205+JmJenna@users.noreply.github.com>
entrotech added a commit that referenced this pull request Nov 20, 2024
* Fix create feature bug

* fix for dynamic vertical centering on mobile (#2266)

* Fix some bugs (#2274)

* Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /client (#2264)

Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md)
- [Commits](chimurai/http-proxy-middleware@v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 2262 feature flag survey and mobile survey (#2269)

* fix feature refetch after add and delete

* Fix user is null when use featureflag

* Update userFeedbacksurvey mobile size

* Undo usefeatureflag hook refech name

* Update App.jsx

Fixed spelling of userFeedbackSurvey

* Fix refresh when add & delete

---------

Co-authored-by: John Darragh <darragh@entrotech.net>

* Update social links (#2279)

* Trigger the fetchMapboxResults function on the leading edge of the wait interval. (#2280)

* Directly install mapbox-gl NPM pkg

* Bumped version number to 1.0.86

* Fix deployment issue, remove validation from social media fields (#2282)

* Bumped version to 1.0.87

* Rebuild package-lock.json files

* Add email and phone input validation (#2284)

* display current location button on mobile (#2283)

* merge vite with develop

* install @types/node

* install @types/node

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Hannah Zulueta <hannahjoy.zulueta@gmail.com>
Co-authored-by: Whitney Gould <78887901+whitneywind@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: June Zhao <60997220+junjun107@users.noreply.github.com>
Co-authored-by: Farhad Siraj <72041242+farhadsiraj@users.noreply.github.com>
Co-authored-by: Jenna <92393205+JmJenna@users.noreply.github.com>
entrotech added a commit that referenced this pull request Nov 20, 2024
* First attempt at deploying with vite

* Added ts types for react-dom, react-gtm-module

* Try to deploy the vite app

* Try again

* try this one

* Allow dist folder

* Update docker file

* Try this

* Try adding !dist folder in docker ignore

* Try this one

* Add mapbox-gl to client/package.json

* Setup client tests (#2268)

* Fix item attribute error

* Vite a (#2286)

* Fix create feature bug

* fix for dynamic vertical centering on mobile (#2266)

* Fix some bugs (#2274)

* Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /client (#2264)

Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md)
- [Commits](chimurai/http-proxy-middleware@v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 2262 feature flag survey and mobile survey (#2269)

* fix feature refetch after add and delete

* Fix user is null when use featureflag

* Update userFeedbacksurvey mobile size

* Undo usefeatureflag hook refech name

* Update App.jsx

Fixed spelling of userFeedbackSurvey

* Fix refresh when add & delete

---------

Co-authored-by: John Darragh <darragh@entrotech.net>

* Update social links (#2279)

* Trigger the fetchMapboxResults function on the leading edge of the wait interval. (#2280)

* Directly install mapbox-gl NPM pkg

* Bumped version number to 1.0.86

* Fix deployment issue, remove validation from social media fields (#2282)

* Bumped version to 1.0.87

* Rebuild package-lock.json files

* Add email and phone input validation (#2284)

* display current location button on mobile (#2283)

* merge vite with develop

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Hannah Zulueta <hannahjoy.zulueta@gmail.com>
Co-authored-by: Whitney Gould <78887901+whitneywind@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: June Zhao <60997220+junjun107@users.noreply.github.com>
Co-authored-by: Farhad Siraj <72041242+farhadsiraj@users.noreply.github.com>
Co-authored-by: Jenna <92393205+JmJenna@users.noreply.github.com>

* Vite a (#2287)

* Fix create feature bug

* fix for dynamic vertical centering on mobile (#2266)

* Fix some bugs (#2274)

* Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /client (#2264)

Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md)
- [Commits](chimurai/http-proxy-middleware@v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 2262 feature flag survey and mobile survey (#2269)

* fix feature refetch after add and delete

* Fix user is null when use featureflag

* Update userFeedbacksurvey mobile size

* Undo usefeatureflag hook refech name

* Update App.jsx

Fixed spelling of userFeedbackSurvey

* Fix refresh when add & delete

---------

Co-authored-by: John Darragh <darragh@entrotech.net>

* Update social links (#2279)

* Trigger the fetchMapboxResults function on the leading edge of the wait interval. (#2280)

* Directly install mapbox-gl NPM pkg

* Bumped version number to 1.0.86

* Fix deployment issue, remove validation from social media fields (#2282)

* Bumped version to 1.0.87

* Rebuild package-lock.json files

* Add email and phone input validation (#2284)

* display current location button on mobile (#2283)

* merge vite with develop

* install @types/node

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Hannah Zulueta <hannahjoy.zulueta@gmail.com>
Co-authored-by: Whitney Gould <78887901+whitneywind@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: June Zhao <60997220+junjun107@users.noreply.github.com>
Co-authored-by: Farhad Siraj <72041242+farhadsiraj@users.noreply.github.com>
Co-authored-by: Jenna <92393205+JmJenna@users.noreply.github.com>

* Vite a (#2288)

* Fix create feature bug

* fix for dynamic vertical centering on mobile (#2266)

* Fix some bugs (#2274)

* Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /client (#2264)

Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md)
- [Commits](chimurai/http-proxy-middleware@v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 2262 feature flag survey and mobile survey (#2269)

* fix feature refetch after add and delete

* Fix user is null when use featureflag

* Update userFeedbacksurvey mobile size

* Undo usefeatureflag hook refech name

* Update App.jsx

Fixed spelling of userFeedbackSurvey

* Fix refresh when add & delete

---------

Co-authored-by: John Darragh <darragh@entrotech.net>

* Update social links (#2279)

* Trigger the fetchMapboxResults function on the leading edge of the wait interval. (#2280)

* Directly install mapbox-gl NPM pkg

* Bumped version number to 1.0.86

* Fix deployment issue, remove validation from social media fields (#2282)

* Bumped version to 1.0.87

* Rebuild package-lock.json files

* Add email and phone input validation (#2284)

* display current location button on mobile (#2283)

* merge vite with develop

* install @types/node

* install @types/node

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Hannah Zulueta <hannahjoy.zulueta@gmail.com>
Co-authored-by: Whitney Gould <78887901+whitneywind@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: June Zhao <60997220+junjun107@users.noreply.github.com>
Co-authored-by: Farhad Siraj <72041242+farhadsiraj@users.noreply.github.com>
Co-authored-by: Jenna <92393205+JmJenna@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Hannah Zulueta <hannahjoy.zulueta@gmail.com>
Co-authored-by: Whitney Gould <78887901+whitneywind@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: June Zhao <60997220+junjun107@users.noreply.github.com>
Co-authored-by: Farhad Siraj <72041242+farhadsiraj@users.noreply.github.com>
Co-authored-by: Jenna <92393205+JmJenna@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Serious Bug: Map - Mobile map pans incorrectly when viewing an organization
3 participants