From 819cfa06cab7bbbcdc179f2c81aee93c90525f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 11 Dec 2024 13:44:35 +0000 Subject: [PATCH 1/4] feat: new header for Rannis org page --- .../Wrapper/OrganizationWrapper.css.ts | 23 ++++++++++++++++++- .../Wrapper/OrganizationWrapper.tsx | 10 ++++++++ .../src/lib/generated/contentfulTypes.d.ts | 1 + .../constants/src/lib/organizationSlug.ts | 1 + 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts b/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts index 695ad30146fe..1c722a766acf 100644 --- a/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts +++ b/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts @@ -1,4 +1,4 @@ -import { style } from '@vanilla-extract/css' +import { globalStyle, style } from '@vanilla-extract/css' import { themeUtils } from '@island.is/island-ui/theme' @@ -253,7 +253,28 @@ export const hveHeaderGridContainerSubpage = style({ }), }) +export const rannisHeaderImage = style({ + // Taken from Default Header styles because when giving className prop this style is overwritten + display: 'grid', + maxWidth: '1342px', + margin: '0 auto', + ...themeUtils.responsiveStyle({ + lg: { + gridTemplateRows: '315px', + gridTemplateColumns: '65fr 35fr', + }, + }), +}) + export const logoLarge = style({ width: '80px', height: '80px', }) + +globalStyle(`${rannisHeaderImage} img:first-of-type`, { + ...themeUtils.responsiveStyle({ + lg: { + opacity: 0.4, + }, + }), +}) diff --git a/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx b/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx index 9c68d0398745..13a8059c93f9 100644 --- a/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx +++ b/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx @@ -618,6 +618,16 @@ export const OrganizationHeader: React.FC< logoImageClassName={styles.logoLarge} /> ) + case 'rannis': + console.log('RANNIS') + console.log(defaultProps) + return ( + + ) default: return } diff --git a/libs/cms/src/lib/generated/contentfulTypes.d.ts b/libs/cms/src/lib/generated/contentfulTypes.d.ts index a03f5f97171d..c9169eb1e512 100644 --- a/libs/cms/src/lib/generated/contentfulTypes.d.ts +++ b/libs/cms/src/lib/generated/contentfulTypes.d.ts @@ -3229,6 +3229,7 @@ export interface IOrganizationPageFields { | 'thjodskjalasafn' | 'faggilding' | 'standalone' + | 'rannis' /** Theme Properties */ themeProperties?: Record | undefined diff --git a/libs/shared/constants/src/lib/organizationSlug.ts b/libs/shared/constants/src/lib/organizationSlug.ts index 88daeeefde15..eb4ba7524a21 100644 --- a/libs/shared/constants/src/lib/organizationSlug.ts +++ b/libs/shared/constants/src/lib/organizationSlug.ts @@ -47,3 +47,4 @@ export type OrganizationSlugType = | 'hugverkastofan' | 'geislavarnir-rikisins' | 'umbodsmadur-skuldara' + | 'rannis' From 8a817dace4a2cd03fc7f3e84487dfc46b22e3512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 11 Dec 2024 14:35:51 +0000 Subject: [PATCH 2/4] refactor: replace gradient and cleanup --- .../Wrapper/OrganizationWrapper.css.ts | 21 ------------------- .../Wrapper/OrganizationWrapper.tsx | 5 +---- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts b/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts index 1c722a766acf..e0820fc9df1d 100644 --- a/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts +++ b/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts @@ -253,28 +253,7 @@ export const hveHeaderGridContainerSubpage = style({ }), }) -export const rannisHeaderImage = style({ - // Taken from Default Header styles because when giving className prop this style is overwritten - display: 'grid', - maxWidth: '1342px', - margin: '0 auto', - ...themeUtils.responsiveStyle({ - lg: { - gridTemplateRows: '315px', - gridTemplateColumns: '65fr 35fr', - }, - }), -}) - export const logoLarge = style({ width: '80px', height: '80px', }) - -globalStyle(`${rannisHeaderImage} img:first-of-type`, { - ...themeUtils.responsiveStyle({ - lg: { - opacity: 0.4, - }, - }), -}) diff --git a/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx b/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx index 13a8059c93f9..84c7498d96a6 100644 --- a/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx +++ b/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx @@ -619,13 +619,10 @@ export const OrganizationHeader: React.FC< /> ) case 'rannis': - console.log('RANNIS') - console.log(defaultProps) return ( ) default: From b11b2e150812d59af16362551c36e0b7a49e9308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Wed, 11 Dec 2024 14:39:29 +0000 Subject: [PATCH 3/4] cleanup --- .../components/Organization/Wrapper/OrganizationWrapper.css.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts b/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts index e0820fc9df1d..695ad30146fe 100644 --- a/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts +++ b/apps/web/components/Organization/Wrapper/OrganizationWrapper.css.ts @@ -1,4 +1,4 @@ -import { globalStyle, style } from '@vanilla-extract/css' +import { style } from '@vanilla-extract/css' import { themeUtils } from '@island.is/island-ui/theme' From 127a7e968369c583686a33da9a3617280d5758f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Tue, 17 Dec 2024 11:47:04 +0000 Subject: [PATCH 4/4] fix: gradient --- .../web/components/Organization/Wrapper/OrganizationWrapper.tsx | 2 +- libs/shared/constants/src/lib/organizationSlug.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx b/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx index 84c7498d96a6..02e5d0341ada 100644 --- a/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx +++ b/apps/web/components/Organization/Wrapper/OrganizationWrapper.tsx @@ -622,7 +622,7 @@ export const OrganizationHeader: React.FC< return ( ) default: diff --git a/libs/shared/constants/src/lib/organizationSlug.ts b/libs/shared/constants/src/lib/organizationSlug.ts index eb4ba7524a21..88daeeefde15 100644 --- a/libs/shared/constants/src/lib/organizationSlug.ts +++ b/libs/shared/constants/src/lib/organizationSlug.ts @@ -47,4 +47,3 @@ export type OrganizationSlugType = | 'hugverkastofan' | 'geislavarnir-rikisins' | 'umbodsmadur-skuldara' - | 'rannis'