-
-
Notifications
You must be signed in to change notification settings - Fork 659
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
Centerer: Remove, as unnecessary. #4868
Conversation
AccountPickScreen and AuthScreen both pass `centerContent` to the `<Screen />` that they use. Empirically, this strategy seems to do just fine on its own in both cases: removing the `<Centerer />` in both cases doesn't seem to change anything at all, in my testing. This is as we'd expect, from reading `Screen`'s interface and noting that it seems to work just fine without a `<Centerer />` in three existing uses. What's more, we have a hypothesis that the `<Centerer />` is causing an important bug that prevents some users from logging in at all, by obscuring crucial pieces of the UI; see https://chat.zulip.org/#narrow/stream/48-mobile/topic/login.20bug/near/1225893.
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.
Thanks @chrisbobbe! I'll be surprised if what's in this component is affecting anything like that bug, but good to clean it up. One comment below.
}, | ||
inner: { | ||
width: '100%', | ||
maxWidth: 480, |
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.
This maxWidth
looks like it was probably doing something. In particular, on AccountPickScreen
, if your screen is wide (like on a tablet, or in landscape on a phone) then I think this is what stops the items in the accounts list from stretching across the whole width.
Maybe move this down into the two callsites? Those are better places for this layout choice to appear anyway.
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.
Makes sense.
Hmm, here's a question about Screen
's interface:
When you pass centerContent
to a Screen
, that gives justifyContent: 'center'
to a container element (so, centers that element's children vertically), but doesn't set alignItems: 'center'
, to center content horizontally; alignItems
is left with its default, 'stretch'. This means children with a maxWidth
aren't centered horizontally, but rather sit to the left. Children without a maxWidth
are stretched to fill the container (so I guess they are effectively centered).
Would it be an improvement to Screen
's interface to have centerContent
set both justifyContent
and alignItems
to 'center'?
https://css-tricks.com/snippets/css/a-guide-to-flexbox/#align-items
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.
Yeah, good find -- I think that would be an improvement.
I'd like to pause on this and will come back once #4893 is resolved. |
We're not totally satisfied with how we annotate `defaultProps` (see f801c97), but it works, and we'd like to remove `Centerer` anyway; issue zulip#4868 is in progress toward that. Related: zulip#4907
We're not totally satisfied with how we annotate `defaultProps` (see f801c97), but it works, and we'd like to remove `Centerer` anyway; issue zulip#4868 is in progress toward that. Related: zulip#4907
Closing as stale, with TODOs added in b55d0b3. |
AccountPickScreen and AuthScreen both pass
centerContent
to the<Screen />
that they use. Empirically, this strategy seems to dojust fine on its own in both cases: removing the
<Centerer />
inboth cases doesn't seem to change anything at all, in my testing.
This is as we'd expect, from reading
Screen
's interface and notingthat it seems to work just fine without a
<Centerer />
in threeexisting uses.
What's more, we have a hypothesis that the
<Centerer />
is causingan important bug that prevents some users from logging in at all, by
obscuring crucial pieces of the UI; see
https://chat.zulip.org/#narrow/stream/48-mobile/topic/login.20bug/near/1225893.