Skip to content

Commit 4ebbbdb

Browse files
committed
fix(LoginPage): allow brand props passthrough and fix brand appearing without props
Signed-off-by: Mohamed Fall <ps.hackmaster@gmail.com>
1 parent bc46a52 commit 4ebbbdb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/react-core/src/components/LoginPage/LoginPage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Fragment } from 'react';
22
import { css } from '@patternfly/react-styles';
33

44
import { BackgroundImage } from '../BackgroundImage';
5-
import { Brand } from '../Brand';
5+
import { Brand, BrandProps } from '../Brand';
66
import { List, ListVariant } from '../List';
77

88
import { Login } from './Login';
@@ -21,6 +21,8 @@ export interface LoginPageProps extends React.HTMLProps<HTMLDivElement> {
2121
brandImgSrc?: string;
2222
/** Attribute that specifies the alt text of the brand image for the login page */
2323
brandImgAlt?: string;
24+
/** Additional props for the brand image for the login page */
25+
brandImgProps?: BrandProps;
2426
/** Attribute that specifies the URL of the background image for the login page */
2527
backgroundImgSrc?: string;
2628
/** Content rendered inside of the text component of the login page */
@@ -50,6 +52,7 @@ export const LoginPage: React.FunctionComponent<LoginPageProps> = ({
5052
className = '',
5153
brandImgSrc = '',
5254
brandImgAlt = '',
55+
brandImgProps,
5356
backgroundImgSrc = '',
5457
footerListItems = null,
5558
textContent = '',
@@ -65,7 +68,7 @@ export const LoginPage: React.FunctionComponent<LoginPageProps> = ({
6568
}: LoginPageProps) => {
6669
const HeaderBrand = (
6770
<Fragment>
68-
<Brand src={brandImgSrc} alt={brandImgAlt} />
71+
{(brandImgSrc || brandImgProps?.src) && <Brand src={brandImgSrc} alt={brandImgAlt} {...brandImgProps} />}
6972
</Fragment>
7073
);
7174
const Header = <LoginHeader headerBrand={HeaderBrand} />;

0 commit comments

Comments
 (0)