Skip to content

Commit

Permalink
Fixed animation image increasing the content height when SAML is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
samilabud committed Apr 2, 2024
1 parent 7841b30 commit 05a0e88
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/pages/signin/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ type RenderOption = {
shouldInitiateSAMLLogin: boolean;
shouldShowWelcomeHeader: boolean;
shouldShowWelcomeText: boolean;
isSAMLEnabled: boolean;
};

type GetRenderOptionsParams = {
Expand Down Expand Up @@ -123,6 +124,7 @@ function getRenderOptions({
shouldInitiateSAMLLogin,
shouldShowWelcomeHeader,
shouldShowWelcomeText,
isSAMLEnabled,
};
}

Expand Down Expand Up @@ -181,6 +183,7 @@ function SignInPageInner({credentials, account, activeClients = [], preferredLoc
shouldInitiateSAMLLogin,
shouldShowWelcomeHeader,
shouldShowWelcomeText,
isSAMLEnabled,
} = getRenderOptions({
hasLogin: !!credentials?.login,
hasValidateCode: !!credentials?.validateCode,
Expand Down Expand Up @@ -260,6 +263,7 @@ function SignInPageInner({credentials, account, activeClients = [], preferredLoc
shouldShowWelcomeText={shouldShowWelcomeText}
ref={signInPageLayoutRef}
navigateFocus={navigateFocus}
isSAMLEnabled={isSAMLEnabled}
>
{/* LoginForm must use the isVisible prop. This keeps it mounted, but visually hidden
so that password managers can access the values. Conditionally rendering this component will break this feature. */}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/signin/SignInPageLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function SignInPageLayout(
shouldShowWelcomeText = false,
navigateFocus = () => {},
children,
isSAMLEnabled = false,
}: SignInPageLayoutProps,
ref: ForwardedRef<SignInPageLayoutRef>,
) {
Expand Down Expand Up @@ -78,7 +79,7 @@ function SignInPageLayout(

const scrollViewStyles = useMemo(() => scrollViewContentContainerStyles(styles), [styles]);

const backgroundImageHeight = Math.max(variables.signInContentMinHeight, containerHeight);
const backgroundImageHeight = Math.max(isSAMLEnabled ? variables.signInSAMLContentMinHeight : variables.signInContentMinHeight, containerHeight);

return (
<View style={containerStyles}>
Expand Down
4 changes: 4 additions & 0 deletions src/pages/signin/SignInPageLayout/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ type SignInPageLayoutProps = {
customHeroBody?: string;

navigateFocus?: () => void;

/** Whether to use the default minimun content height or the recommened one
* for login with SAML at the login page */
isSAMLEnabled?: boolean;
};

type SignInPageLayoutRef = {
Expand Down
1 change: 1 addition & 0 deletions src/styles/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export default {
signInContentMaxWidth: 1360,
signInHeroContextMaxWidth: 680,
signInContentMinHeight: 800,
signInSAMLContentMinHeight: 1000,
signInLogoHeightSmallScreen: 28,
signInLogoHeight: 34,
signInLogoWidth: 120,
Expand Down

0 comments on commit 05a0e88

Please sign in to comment.