-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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: LoginPage for wide screens #6137
Changes from 7 commits
3d5b543
f247ac1
7ee51cb
024040d
a096768
44ad2b0
2662ee0
3eec0a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
import SVGImage from '../../../components/SVGImage'; | ||
import styles from '../../../styles/styles'; | ||
import * as StyleUtils from '../../../styles/StyleUtils'; | ||
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions'; | ||
|
||
const propTypes = { | ||
/** The children to show inside the Container */ | ||
children: PropTypes.node.isRequired, | ||
|
||
...windowDimensionsPropTypes, | ||
}; | ||
|
||
const backgroundStyle = StyleUtils.getLoginPagePromoStyle(); | ||
|
||
const SignInPageWideContainer = props => ( | ||
<View style={[styles.flex1, styles.signInPageInner]}> | ||
<View style={[styles.flex1, styles.flexRow, styles.flexGrow1]}> | ||
{props.children} | ||
<View style={[ | ||
styles.flexGrow1, | ||
StyleUtils.getBackgroundColorStyle(backgroundStyle.backgroundColor), | ||
props.isMediumScreenWidth && styles.alignItemsCenter, | ||
]} | ||
> | ||
<SVGImage | ||
width="100%" | ||
height="100%" | ||
src={backgroundStyle.backgroundImageUri} | ||
/> | ||
</View> | ||
</View> | ||
</View> | ||
); | ||
|
||
SignInPageWideContainer.propTypes = propTypes; | ||
SignInPageWideContainer.displayName = 'SignInPageWideContainer'; | ||
|
||
export default withWindowDimensions(SignInPageWideContainer); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import SignInPageLayoutNarrow from './SignInPageLayoutNarrow'; | ||
import SignInPageLayoutWide from './SignInPageLayoutWide'; | ||
import SignInPageContent from './SignInPageContent'; | ||
import SignInPageWideContainer from './SignInPageWideContainer'; | ||
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions'; | ||
|
||
const propTypes = { | ||
|
@@ -18,26 +18,22 @@ const propTypes = { | |
...windowDimensionsPropTypes, | ||
}; | ||
|
||
const SignInPageLayout = props => ( | ||
!props.isSmallScreenWidth | ||
? ( | ||
<SignInPageLayoutWide | ||
welcomeText={props.welcomeText} | ||
isMediumScreenWidth={props.isMediumScreenWidth} | ||
shouldShowWelcomeText={props.shouldShowWelcomeText} | ||
> | ||
{props.children} | ||
</SignInPageLayoutWide> | ||
) | ||
: ( | ||
<SignInPageLayoutNarrow | ||
welcomeText={props.welcomeText} | ||
shouldShowWelcomeText={props.shouldShowWelcomeText} | ||
> | ||
{props.children} | ||
</SignInPageLayoutNarrow> | ||
) | ||
); | ||
const SignInPageLayout = (props) => { | ||
const content = ( | ||
<SignInPageContent | ||
welcomeText={props.welcomeText} | ||
shouldShowWelcomeText={props.shouldShowWelcomeText} | ||
> | ||
{props.children} | ||
</SignInPageContent> | ||
); | ||
|
||
if (props.isSmallScreenWidth) { | ||
return content; | ||
} | ||
|
||
return <SignInPageWideContainer>{content}</SignInPageWideContainer>; | ||
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. Is there really an advantage to having the 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. It looks clean this way but let me know I can merge. 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. I just merged. Thanks for the suggestion. 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. Thanks, I appreciate your willingness to do that. 👍 |
||
}; | ||
|
||
SignInPageLayout.propTypes = propTypes; | ||
SignInPageLayout.displayName = 'SignInPageLayout'; | ||
|
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.
Indentation looks a little weird here. Maybe
]}>
?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.
Actually, it's totally fine. There are two ways here.
This one
e.g.
App/src/pages/home/report/ReportActionCompose.js
Lines 499 to 506 in 5362f01
and
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.
Huh, Ok well that's fine with me. This was a NAB.