-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Signin rhp #24083
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
Signin rhp #24083
Changes from all commits
d98441f
f24e7ce
b4f495f
cd30cf9
53b6fa9
10b82c2
2c5842c
68bdb8f
8320e5d
78a5641
961366d
fd26e25
83652fd
a77cdb3
e0dd7eb
f346c40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,4 +207,5 @@ export default { | |
| isSubReportPageRoute: pathSegments.length > 2, | ||
| }; | ||
| }, | ||
| SIGN_IN_MODAL: 'sign-in-modal', | ||
| }; | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -48,6 +48,11 @@ Onyx.connect({ | |||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| currentAccountID = val.accountID; | ||||||||||||||||
| if (Navigation.isActiveRoute(ROUTES.SIGN_IN_MODAL)) { | ||||||||||||||||
| // This means sign in in RHP was successful, so we can dismiss the modal and subscribe to user events | ||||||||||||||||
| Navigation.dismissModal(); | ||||||||||||||||
| User.subscribeToUserEvents(); | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Came from this issue Like here App/src/libs/Navigation/AppNavigator/AuthScreens.tsx Lines 255 to 261 in f58439c
|
||||||||||||||||
| } | ||||||||||||||||
| }, | ||||||||||||||||
| }); | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import React from 'react'; | ||
| import SignInPage from './SignInPage'; | ||
| import ScreenWrapper from '../../components/ScreenWrapper'; | ||
| import HeaderWithBackButton from '../../components/HeaderWithBackButton'; | ||
| import Navigation from '../../libs/Navigation/Navigation'; | ||
| import styles from '../../styles/styles'; | ||
| import * as Session from '../../libs/actions/Session'; | ||
|
|
||
| const propTypes = {}; | ||
|
|
||
| const defaultProps = {}; | ||
|
|
||
| function SignInModal() { | ||
| if (!Session.isAnonymousUser()) { | ||
| // Sign in in RHP is only for anonymous users | ||
| Navigation.isNavigationReady().then(() => { | ||
| Navigation.dismissModal(); | ||
| }); | ||
| } | ||
| return ( | ||
| <ScreenWrapper | ||
| style={[styles.highlightBG]} | ||
| includeSafeAreaPaddingBottom={false} | ||
| shouldEnableMaxHeight | ||
| > | ||
| <HeaderWithBackButton onBackButtonPress={() => Navigation.goBack()} /> | ||
| <SignInPage isInModal /> | ||
| </ScreenWrapper> | ||
| ); | ||
| } | ||
|
|
||
| SignInModal.propTypes = propTypes; | ||
| SignInModal.defaultProps = defaultProps; | ||
| SignInModal.displayName = 'SignInModal'; | ||
|
|
||
| export default SignInModal; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,9 @@ const propTypes = { | |
| /** Whether to show welcome header on a particular page */ | ||
| shouldShowWelcomeHeader: PropTypes.bool.isRequired, | ||
|
|
||
| /** Whether or not the sign in page is being rendered in the RHP modal */ | ||
| isInModal: PropTypes.bool.isRequired, | ||
|
daordonez11 marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When making this required, we forgot to update the props for this component in |
||
|
|
||
| /** Override the green headline copy */ | ||
| customHeadline: PropTypes.string, | ||
|
|
||
|
|
@@ -51,11 +54,12 @@ function SignInPageLayout(props) { | |
| const prevPreferredLocale = usePrevious(props.preferredLocale); | ||
| let containerStyles = [styles.flex1, styles.signInPageInner]; | ||
| let contentContainerStyles = [styles.flex1, styles.flexRow]; | ||
| const shouldShowSmallScreen = props.isSmallScreenWidth || props.isInModal; | ||
|
|
||
| // To scroll on both mobile and web, we need to set the container height manually | ||
| const containerHeight = props.windowHeight - props.insets.top - props.insets.bottom; | ||
|
|
||
| if (props.isSmallScreenWidth) { | ||
| if (shouldShowSmallScreen) { | ||
| containerStyles = [styles.flex1]; | ||
| contentContainerStyles = [styles.flex1, styles.flexColumn]; | ||
| } | ||
|
|
@@ -77,7 +81,7 @@ function SignInPageLayout(props) { | |
|
|
||
| return ( | ||
| <View style={containerStyles}> | ||
| {!props.isSmallScreenWidth ? ( | ||
| {!shouldShowSmallScreen ? ( | ||
| <View style={contentContainerStyles}> | ||
| <SignInPageContent | ||
| welcomeHeader={props.welcomeHeader} | ||
|
|
||
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.
Seems we are closing the modal early which causes the issue #36976