ASU-CodeDevils / codedevils.org

The Official CodeDevils website frontend codebase written using Next.js, React, TypeScript, and Tailwind CSS
https://www.codedevils.org
10 stars 6 forks source link

Fix mobile/desktop identifier in AppContext #33

Closed jtmichelson closed 1 year ago

jtmichelson commented 1 year ago

Currently we just read the innerWidth: https://github.com/ASU-CodeDevils/codedevils/blob/56a77d9929c2133716ea311af891197aab129987/src/contexts/AppContext.jsx#L13

According to MDN this is a "Crude way to check that the screen is at least 1024x768": https://developer.mozilla.org/en-US/docs/Web/API/Screen/width

We can check the navigator.userAgent and we can also detect if the device has a touch screen. You can fallback to a screen width reading if necessary.

fernandonevarez commented 1 year ago

good to know, but we aren't using the react context API anymore.