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

feat(web): Add logoImageClassName to default header #16582

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/web/components/DefaultHeader/DefaultHeader.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ export const logo = style({
height: '70px',
})

export const logoLarge = style({
width: '80px',
height: '80px',
})
mannipje marked this conversation as resolved.
Show resolved Hide resolved

export const logoSubpage = style({
width: '30px',
height: '30px',
Expand Down
17 changes: 15 additions & 2 deletions apps/web/components/DefaultHeader/DefaultHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface DefaultHeaderProps {
imageObjectPosition?: 'left' | 'center' | 'right'
className?: string
titleClassName?: string
logoImageClassName?: boolean
mannipje marked this conversation as resolved.
Show resolved Hide resolved
mannipje marked this conversation as resolved.
Show resolved Hide resolved
logoAltText?: string
isSubpage?: boolean
}
Expand All @@ -55,6 +56,7 @@ export const DefaultHeader: React.FC<
imageObjectPosition = 'center',
className,
titleClassName,
logoImageClassName,
logoAltText,
titleSectionPaddingLeft,
isSubpage,
Expand Down Expand Up @@ -88,7 +90,13 @@ export const DefaultHeader: React.FC<
borderRadius="circle"
background="white"
>
<img className={styles.logo} src={logo} alt={logoAltText} />
<img
className={cn(styles.logo, {
[styles.logoLarge]: logoImageClassName,
})}
src={logo}
alt={logoAltText}
/>
</Box>
</LinkWrapper>
</div>
Expand Down Expand Up @@ -140,7 +148,12 @@ export const DefaultHeader: React.FC<
background="white"
>
<img
className={isSubpage ? styles.logoSubpage : styles.logo}
className={cn(
isSubpage ? styles.logoSubpage : styles.logo,
{
[styles.logoLarge]: logoImageClassName,
},
)}
mannipje marked this conversation as resolved.
Show resolved Hide resolved
src={logo}
alt={logoAltText}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,13 @@ export const OrganizationHeader: React.FC<
customTitleColor={n('tryggingastofnunHeaderTitleColor', '#007339')}
/>
)
case 'faggilding':
return (
<DefaultHeader
{...defaultProps}
logoImageClassName={n('faggildingLogoImageLarge', false)}
/>
)
mannipje marked this conversation as resolved.
Show resolved Hide resolved
default:
return <DefaultHeader {...defaultProps} />
}
Expand Down
Loading