Closed Brenosalv closed 1 month ago
Visit the preview URL for this PR (updated for commit 8bd7011):
https://estuary-marketing--pr307-brenosalv-bug-help-c-1jwe055u.web.app
(expires Sun, 23 Jun 2024 18:32:39 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
Sign: 76f6b095a0752e5d9c6c890267f9fdc3e392161e
Lighthouse reports in incognito mode for homepage:
Desktop:
Mobile:
Desktop report with the help chat placeholder:
So comparing the live analysis from Google and dynamic loading did not make an impact. Let's go ahead and put it back to how it was loading and just go with the new React component approach you made to solve the state issues.
@travjenkins I think we don't need the component because we don't need the state. We just need to check if the screen width or height is less than 768px on load/first render and we can do it without states. Please let me know if you aggree.
@Brenosalv - We need the state as this will cause issues with SSR as window will not exist. So once the static site is provided there will be a change and a render will need to be done again.
The problem that was causing the help chat to not show up sometimes was the initial state. I fixed this replacing the intial state with the current screen size.
308
Changes
Tests / Screenshots
Help Chat:![image](https://github.com/estuary/marketing-site/assets/60396753/80e351d8-3b40-44ef-bab8-85aa5ceef3ab)
React in the gatsby-browser.tsx![image](https://github.com/estuary/marketing-site/assets/60396753/51495626-ce77-494d-82ff-820a555b8dfe)