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
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 : {},
!props.isMediumScreenWidth ? styles.signInPageWideLeftContentMargin : {},
styles.mb3,
StyleUtils.getModalPaddingStyles({
shouldAddBottomSafeAreaPadding: true,
Expand Down
53 changes: 34 additions & 19 deletions src/pages/signin/SignInPageLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import SVGImage from '../../../components/SVGImage';
import styles from '../../../styles/styles';
import * as StyleUtils from '../../../styles/StyleUtils';
import * as Link from '../../../libs/actions/Link';
import variables from '../../../styles/variables';

const propTypes = {
/** The children to show inside the layout */
Expand Down Expand Up @@ -35,34 +36,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 && props.windowHeight >= variables.minHeigthToShowGraphics) {
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
1 change: 1 addition & 0 deletions src/styles/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ export default {
tooltipzIndex: 10050,
gutterWidth: 16,
popoverMenuShadow: '0px 4px 12px 0px rgba(0, 0, 0, 0.06)',
minHeightToShowGraphics: 854, // below this height UI was broken on login form layout as there isn't enough height to show forma and graphics.
};