-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[R20-1274] add site wide corner graphics, remove content type headers
- Loading branch information
Showing
31 changed files
with
178 additions
and
269 deletions.
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
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
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
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
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
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
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,97 @@ | ||
<script setup lang="ts"> | ||
import { computed, inject } from 'vue' | ||
import { TideHeroHeader } from '../types' | ||
import type { IRplFeatureFlags } from '@dpc-sdp/ripple-tide-api/types' | ||
import { TideImageField } from '@dpc-sdp/ripple-tide-api/types' | ||
interface Props { | ||
header: TideHeroHeader | ||
hasBreadcrumbs: boolean | ||
hideBottomCornerGraphic?: boolean | ||
behindNav?: boolean | ||
cornerTop?: TideImageField | ||
cornerBottom?: TideImageField | ||
} | ||
const props = withDefaults(defineProps<Props>(), { | ||
behindNav: true, | ||
hideBottomCornerGraphic: false, | ||
cornerTop: null, | ||
cornerBottom: null | ||
}) | ||
const cornerTop = computed(() => { | ||
if (props.header?.backgroundImage) { | ||
return false | ||
} | ||
return props.header?.cornerTop?.src || props.cornerTop?.src || true | ||
}) | ||
const cornerBottom = computed(() => { | ||
if (props.header?.backgroundImage || props.hideBottomCornerGraphic) { | ||
return false | ||
} | ||
return props.header?.cornerBottom?.src || props.cornerBottom?.src || true | ||
}) | ||
const secondaryAction = computed(() => { | ||
if (!props.header?.secondaryAction) { | ||
return null | ||
} | ||
return { | ||
...props.header.secondaryAction, | ||
title: props.header?.secondaryActionLabel | ||
} | ||
}) | ||
const headerLinks = computed(() => { | ||
if (!props.header?.links) { | ||
return null | ||
} | ||
return { | ||
title: props.header.links?.title, | ||
items: props.header.links?.items, | ||
more: props.header.links?.more | ||
} | ||
}) | ||
const featureFlags: IRplFeatureFlags = inject('featureFlags', { | ||
headerTheme: 'default' | ||
}) | ||
const headerTheme = computed(() => { | ||
/* | ||
Theme logic : Reverse and Image variants use the Neutral styling for the blocked title and introduction text. | ||
The Neutral styling does not affect the ‘Default’ variant of the Header. | ||
*/ | ||
if (props.header?.backgroundImage || props.header?.theme === 'reverse') { | ||
if (featureFlags?.headerTheme) { | ||
return featureFlags.headerTheme | ||
} | ||
return props.header?.theme || 'default' | ||
} | ||
return props.header?.theme || 'default' | ||
}) | ||
</script> | ||
|
||
<template> | ||
<RplHeroHeader | ||
:title="header.title" | ||
:links="headerLinks" | ||
:theme="headerTheme" | ||
:logo="header?.logoImage" | ||
:behindNav="behindNav" | ||
:breadcrumbs="hasBreadcrumbs" | ||
:cornerTop="cornerTop" | ||
:cornerBottom="cornerBottom" | ||
:background="header?.backgroundImage" | ||
:primaryAction="header?.primaryAction" | ||
:secondaryAction="secondaryAction" | ||
> | ||
{{ header.summary }} | ||
</RplHeroHeader> | ||
</template> |
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.