-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: added bowser to detect mobile or desktop #52
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple of questions
// TODO remove this after testing | ||
console.log(`Is this a mobile? "${isMobile}"`); | ||
console.log(`Is this a desktop? "${isDesktop}"`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested that the booleans are set properly at this point? You could test it on mobile by doing some conditional rendering based on if isMobile
is true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested that the booleans are set properly at this point? You could test it on mobile by doing some conditional rendering based on if
isMobile
is true
Tested on chrome browser, where i switched view in dev mode and tested on x-code simulator to test apple-devices, worked in both.
But isn't great at detecting tablet. Only ipad mini is detected as tablet the bigger screens are detected as desktop.
08fa9e0
to
798de1d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff! What do you think about having only isMobile
and aim to have two designs (mobile specific, and all other devices)?
The more booleans we have, the more complex the support matrix becomes. E.g. I'd rather check if (!isMobile)
than have to check if (isDesktop || isTablet)
.
If you agree, I think we can have only isMobile
, remove the console logs, and then merge!
My thought exactly, as long as we just want to restrict just the mobile-experience there is no need for the other checks. |
No description provided.