-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Create Mobile Editor Endpoint #1455
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
Create Mobile Editor Endpoint #1455
Conversation
client/routes.jsx
Outdated
// const isMobile = () => window.innerWidth <= 760; | ||
// const IDEView = isMobile() && !ignoreMobile() ? IDEViewMobileScreen : IDEViewScreen; | ||
|
||
// How to use URL as a prop? |
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.
@ghalestrilo What is it you want to use the URL for? Maybe I can help?
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.
@andrewn the idea here is to have a url parameter to render the desktop view even if the user is on a small screen.
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.
also @ghalestrilo if possible, i'd prefer to not merge in commented out code, so would it be possible to remove this for now?
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.
Hi guys, sorry for the delay.
Absolutely, will update this right now. @andrewn I had coded a way to bypass the /mobile
view through a URL parameter, using window.location
, and @catarak suggested we instead used the query parameter as a prop.
I wrote the comment because I didn't know how to do it at the moment, but I think following the react-router documentation will be simple enough :)
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.
I see. Yeah, there's no way to specify it in the Route
and react-router doesn't automatically parse it ASFAIK.
I usually:
- Get the
location
object passed into the mounted component (or thewithRouter
HoC, or theuseLocation
hook). - Pass
location.search
into the browser's nativeURLSearchParams
helper
What I've used in the past, is fetching the querystring from location.search
|
||
const Header = styled.div` | ||
width: 100%; | ||
background-color: ${background} !important; |
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.
do you need to use !important
here? i'd prefer not to use it ever unless absolutely necessary (e.g. overriding styles from another library).
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 point, will change this
I know this is in progress, but I made a couple of code clean up suggestions! Otherwise this is great. |
Part of the Mobile Web Editor project.
This PR creates a
/mobile
endpoint, rendering a new screen, which will be used for the development of the mobile web editor. This screen is enabled/disabled through theMOBILE_ENABLED
environment variable.Currently it's just groundwork getting done. Future PRs will implement its design and behavior.
I have verified that this pull request:
npm run lint
)Fixes #123