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

login form layout for ipad #8752

Merged
merged 10 commits into from
May 20, 2022
1 change: 1 addition & 0 deletions config/webpack/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = (env = {}) => {
devServer: {
contentBase: path.join(__dirname, '../../dist'),
hot: true,
host: '0.0.0.0',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this, it doesn’t need to be committed!

You can pass host to the webpack by just adding --host 0.0.0.0 to the yarn web command.

...proxySettings,
historyApiFallback: true,
},
Expand Down
3 changes: 2 additions & 1 deletion src/pages/signin/SignInPageLayout/SignInPageContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ const SignInPageContent = props => (
<LoginKeyboardAvoidingView
behavior="position"
contentContainerStyle={[
props.isSmallScreenWidth ? styles.signInPageNarrowContentMargin : styles.signInPageWideLeftContentMargin,
props.isSmallScreenWidth && styles.signInPageNarrowContentMargin,
Copy link
Contributor

Choose a reason for hiding this comment

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

When props.isSmallScreenWidth is falsy, this would end up with an array with a null or false element, is that allowed? (same below)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice catch! Let's refactor as below,

                    props.isSmallScreenWidth ? styles.signInPageNarrowContentMargin : {},

@aneequeahmad

!props.isMediumScreenWidth && styles.signInPageWideLeftContentMargin,
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment I left for the line above also applied to this one

styles.mb3,
StyleUtils.getModalPaddingStyles({
shouldAddBottomSafeAreaPadding: true,
Expand Down
52 changes: 33 additions & 19 deletions src/pages/signin/SignInPageLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,48 @@ const SignInPageLayout = (props) => {
</SignInPageContent>
);

const hasRedirect = !_.isEmpty(backgroundStyle.redirectUri);

const graphicLayout = (
<Pressable
style={[
styles.flex1,
StyleUtils.getBackgroundColorStyle(backgroundStyle.backgroundColor),
]}
onPress={() => {
Link.openExternalLink(backgroundStyle.redirectUri);
}}
disabled={!hasRedirect}
>
<SVGImage
width="100%"
height="100%"
src={backgroundStyle.backgroundImageUri}
resizeMode={props.isMediumScreenWidth ? 'contain' : 'cover'}
/>
</Pressable>
);

if (props.isSmallScreenWidth) {
return content;
}

const hasRedirect = !_.isEmpty(backgroundStyle.redirectUri);
if (props.isMediumScreenWidth) {
return (
<View style={[styles.dFlex, styles.signInPageInner, styles.flexColumnReverse, styles.justifyContentBetween]}>
{graphicLayout}
<View style={styles.flex1}>
{content}
</View>
</View>
);
}

return (
<View style={[styles.flex1, styles.signInPageInner]}>
<View style={[styles.flex1, styles.flexRow, styles.flexGrow1]}>
{content}
<Pressable
style={[
styles.flexGrow1,
StyleUtils.getBackgroundColorStyle(backgroundStyle.backgroundColor),
props.isMediumScreenWidth && styles.alignItemsCenter,
]}
onPress={() => {
Link.openExternalLink(backgroundStyle.redirectUri);
}}
disabled={!hasRedirect}
>
<SVGImage
width="100%"
height="100%"
src={backgroundStyle.backgroundImageUri}
resizeMode={props.isMediumScreenWidth ? 'contain' : 'cover'}
/>
</Pressable>
{graphicLayout}
</View>
</View>
);
Expand Down