-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eb): Add default header for sjukratryggingar organization (#16012)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
150ab3a
commit eb982d4
Showing
4 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...ts/Organization/Wrapper/Themes/SjukratryggingarTheme/SjukratryggingarDefaultHeader.css.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
export const gridContainerWidth = style({ | ||
maxWidth: '1342px', | ||
margin: '0 auto', | ||
}) |
68 changes: 68 additions & 0 deletions
68
...nents/Organization/Wrapper/Themes/SjukratryggingarTheme/SjukratryggingarDefaultHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import React from 'react' | ||
|
||
import { ResponsiveSpace } from '@island.is/island-ui/core' | ||
import { theme } from '@island.is/island-ui/theme' | ||
import { DefaultHeader } from '@island.is/web/components' | ||
import { OrganizationPage } from '@island.is/web/graphql/schema' | ||
import { useLinkResolver } from '@island.is/web/hooks/useLinkResolver' | ||
import { useWindowSize } from '@island.is/web/hooks/useViewport' | ||
|
||
import * as styles from './SjukratryggingarDefaultHeader.css' | ||
|
||
interface HeaderProps { | ||
organizationPage: OrganizationPage | ||
logoAltText: string | ||
isSubpage: boolean | ||
} | ||
|
||
const SjukratryggingarDefaultHeader: React.FC< | ||
React.PropsWithChildren<HeaderProps> | ||
> = ({ organizationPage, logoAltText, isSubpage }) => { | ||
const { linkResolver } = useLinkResolver() | ||
|
||
const { width } = useWindowSize() | ||
|
||
const themeProp = organizationPage.themeProperties | ||
|
||
return ( | ||
<div | ||
style={{ | ||
background: | ||
width <= theme.breakpoints.sm | ||
? '#40c5e5' | ||
: (width > theme.breakpoints.lg && !isSubpage | ||
? themeProp.backgroundColor | ||
: `linear-gradient(184.95deg, #40c5e5 8.38%, rgba(64, 197, 227, 0.1) 39.64%, rgba(244, 247, 247, 0) 49.64%), | ||
linear-gradient(273.41deg, #f4f7f7 -9.24%, #40c5e5 66.78%, #a4def1 105.51%)`) ?? | ||
'', | ||
}} | ||
className={styles.gridContainerWidth} | ||
> | ||
<DefaultHeader | ||
title={organizationPage.title} | ||
titleColor="dark400" | ||
imagePadding={themeProp.imagePadding ?? '0'} | ||
fullWidth={themeProp.fullWidth ?? false} | ||
imageIsFullHeight={themeProp.imageIsFullHeight ?? false} | ||
imageObjectFit={ | ||
themeProp?.imageObjectFit === 'cover' ? 'cover' : 'contain' | ||
} | ||
logo={organizationPage.organization?.logo?.url} | ||
logoHref={ | ||
linkResolver('organizationpage', [organizationPage.slug]).href | ||
} | ||
logoAltText={logoAltText} | ||
titleSectionPaddingLeft={ | ||
organizationPage.themeProperties | ||
.titleSectionPaddingLeft as ResponsiveSpace | ||
} | ||
isSubpage={isSubpage} | ||
mobileBackground={ | ||
organizationPage.themeProperties.mobileBackgroundColor | ||
} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default SjukratryggingarDefaultHeader |
2 changes: 2 additions & 0 deletions
2
apps/web/components/Organization/Wrapper/Themes/SjukratryggingarTheme/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters