From 399753260c355724ee470fbdc12230afd4d766ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rmann=20P=C3=A9tur=20=C3=86varsson?= Date: Thu, 12 Sep 2024 13:27:12 +0000 Subject: [PATCH] Add default header for fiskistofa organization --- .../Wrapper/OrganizationWrapper.tsx | 13 +++- .../FiskistofaDefaultHeader.css.ts | 6 ++ .../FiskistofaDefaultHeader.tsx | 65 +++++++++++++++++++ .../Wrapper/Themes/FiskistofaTheme/index.ts | 2 + 4 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 apps/web/components/Organization/Wrapper/Themes/FiskistofaTheme/FiskistofaDefaultHeader.css.ts create mode 100644 apps/web/components/Organization/Wrapper/Themes/FiskistofaTheme/FiskistofaDefaultHeader.tsx diff --git a/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx b/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx index b8eeb3228f33..8ab52c6f7263 100644 --- a/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx +++ b/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx @@ -59,7 +59,10 @@ import { getBackgroundStyle } from '@island.is/web/utils/organization' import { LatestNewsCardConnectedComponent } from '../LatestNewsCardConnectedComponent' import { DigitalIcelandHeader } from './Themes/DigitalIcelandTheme' -import { FiskistofaHeader } from './Themes/FiskistofaTheme' +import { + FiskistofaDefaultHeader, + FiskistofaHeader, +} from './Themes/FiskistofaTheme' import { FiskistofaFooter } from './Themes/FiskistofaTheme' import { FjarsyslaRikisinsFooter, @@ -328,7 +331,13 @@ export const OrganizationHeader: React.FC< /> ) case 'fiskistofa': - return ( + return n('usingDefaultHeader', false) ? ( + + ) : ( +> = ({ organizationPage, logoAltText, isSubpage }) => { + const { linkResolver } = useLinkResolver() + + const { width } = useWindowSize() + + const themeProp = organizationPage.themeProperties + + return ( +
theme.breakpoints.lg && !isSubpage + ? themeProp.backgroundColor + : 'no-repeat 52% 30% ,linear-gradient(180deg, #E6F2FB 21.56%, #90D9E3 239.74%)') ?? + '', + }} + className={styles.gridContainerWidth} + > + +
+ ) +} + +export default FiskistofaDefaultHeader diff --git a/apps/web/components/Organization/Wrapper/Themes/FiskistofaTheme/index.ts b/apps/web/components/Organization/Wrapper/Themes/FiskistofaTheme/index.ts index 4497a9ecb32e..96e40c6a2cd7 100644 --- a/apps/web/components/Organization/Wrapper/Themes/FiskistofaTheme/index.ts +++ b/apps/web/components/Organization/Wrapper/Themes/FiskistofaTheme/index.ts @@ -1,5 +1,6 @@ import dynamic from 'next/dynamic' +import DefaultHeader from './FiskistofaDefaultHeader' import Header from './FiskistofaHeader' export const FiskistofaFooter = dynamic(() => import('./FiskistofaFooter'), { @@ -7,3 +8,4 @@ export const FiskistofaFooter = dynamic(() => import('./FiskistofaFooter'), { }) export const FiskistofaHeader = Header +export const FiskistofaDefaultHeader = DefaultHeader