Skip to content

Commit

Permalink
fix "Going from small to large screen and vice-versa clears the field…
Browse files Browse the repository at this point in the history
… for Email/Password input fields"
  • Loading branch information
aimane-chnaif committed Sep 26, 2022
1 parent 5ee80d7 commit 32111b9
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/pages/signin/SignInPageLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,26 @@ const SignInPageLayout = (props) => {
</Pressable>
);

if (props.isSmallScreenWidth) {
return content;
}
const containerStyles = [];
const contentContainerStyles = [styles.flex1];

if (props.isMediumScreenWidth && props.windowHeight >= variables.minHeightToShowGraphics) {
return (
<View style={[styles.dFlex, styles.signInPageInner, styles.flexColumnReverse, styles.justifyContentBetween]}>
{graphicLayout}
<View style={styles.flex1}>
{content}
</View>
</View>
);
const isLongMediumScreenWidth = props.isMediumScreenWidth && props.windowHeight >= variables.minHeightToShowGraphics;

if (props.isSmallScreenWidth) {
containerStyles.push(styles.flex1);
} else if (isLongMediumScreenWidth) {
containerStyles.push(styles.dFlex, styles.signInPageInner, styles.flexColumnReverse, styles.justifyContentBetween);
} else {
containerStyles.push(styles.flex1, styles.signInPageInner);
contentContainerStyles.push(styles.flexRow);
}

return (
<View style={[styles.flex1, styles.signInPageInner]}>
<View style={[styles.flex1, styles.flexRow, styles.flexGrow1]}>
<View style={containerStyles}>
{isLongMediumScreenWidth && graphicLayout}
<View style={contentContainerStyles}>
{content}
{graphicLayout}
{!props.isSmallScreenWidth && !isLongMediumScreenWidth && graphicLayout}
</View>
</View>
);
Expand Down

0 comments on commit 32111b9

Please sign in to comment.