Skip to content
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

Fix sign in top content scroll conflict with the sign in page #26150

Merged
merged 4 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/pages/signin/SignInPageLayout/SignInPageContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const propTypes = {
* on form type (for example. sign in) and small vs large screens */
welcomeHeader: PropTypes.string.isRequired,

/** Whether to show the sign in content in a small screen style */
shouldShowSmallScreen: PropTypes.bool.isRequired,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/** Whether to show the sign in content in a small screen style */
shouldShowSmallScreen: PropTypes.bool.isRequired,
/** Whether the content page be scrollable */
shouldContentScroll: PropTypes.bool.isRequired,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new name makes me think it's cleaner if we move the ScrollView from SignInPageContent to SignInPageLayout for a large screen (my alternative solution). What do you think?

{!shouldShowSmallScreen ? (
    <View>
        <ScrollView ...>
            <SignInPageContent />
        </ScrollView>

No issue found so far with this approach.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that looks better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!


/** Whether to show welcome text on a particular page */
shouldShowWelcomeText: PropTypes.bool.isRequired,

Expand All @@ -41,7 +44,7 @@ function SignInPageContent(props) {
<ScrollView
contentContainerStyle={[styles.flex1, styles.signInPageLeftContainer]}
keyboardShouldPersistTaps="handled"
style={[!props.isSmallScreenWidth && styles.signInPageLeftContainerWide, styles.flex1]}
style={[!props.isSmallScreenWidth && styles.signInPageLeftContainerWide, styles.flex1, props.shouldShowSmallScreen && styles.overflowHidden]}
>
<View style={[styles.flex1, styles.alignSelfCenter, styles.signInPageWelcomeFormContainer]}>
{/* This empty view creates margin on the top of the sign in form which will shrink and grow depending on if the keyboard is open or not */}
Expand Down
2 changes: 2 additions & 0 deletions src/pages/signin/SignInPageLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function SignInPageLayout(props) {
<SignInPageContent
welcomeHeader={props.welcomeHeader}
welcomeText={props.welcomeText}
shouldShowSmallScreen={false}
shouldShowWelcomeText={props.shouldShowWelcomeText}
shouldShowWelcomeHeader={props.shouldShowWelcomeHeader}
>
Expand Down Expand Up @@ -149,6 +150,7 @@ function SignInPageLayout(props) {
<SignInPageContent
welcomeHeader={props.welcomeHeader}
welcomeText={props.welcomeText}
shouldShowSmallScreen
shouldShowWelcomeText={props.shouldShowWelcomeText}
shouldShowWelcomeHeader={props.shouldShowWelcomeHeader}
>
Expand Down
Loading