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

feature: add support for secondary nav on EDU Collections template #650

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion packages/vue/src/components/NavSecondary/NavSecondary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}"
>
<div
class="max-w-screen-3xl mx-auto"
class="w-full mx-auto"
:class="{ 'bg-gradient-to-r from-black to-primary bg-transparent to-90% text-white': invert }"
>
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BlockRelatedLinksData } from './../../../components/BlockRelatedLinks/BlockRelatedLinks.stories.js'
import { BlockLinkCardCarouselData } from './../../../components/BlockLinkCarousel/BlockLinkCarousel.stories.js'
import { BlockStreamfieldMinimalData } from './../../../components/BlockStreamfield/BlockStreamfield.stories'
import { NavSecondaryData } from './../../../components/NavSecondary/NavSecondary.stories.js'
import PageEduCollectionsDetail from './PageEduCollectionsDetail.vue'

export default {
Expand Down Expand Up @@ -102,3 +103,39 @@ export const NoMetaPanel = {
}
}
}

export const NoHero = {
args: {
data: {
...BaseStory.args.data,
heroImage: undefined
}
}
}

export const SecondaryNav = {
args: {
data: {
...BaseStory.args.data,
breadcrumb: NavSecondaryData.breadcrumb
}
}
}
export const SecondaryNavHeroInline = {
args: {
data: {
...BaseStory.args.data,
breadcrumb: NavSecondaryData.breadcrumb,
heroPosition: 'inline'
}
}
}
export const SecondaryNavNoHero = {
args: {
data: {
...BaseStory.args.data,
breadcrumb: NavSecondaryData.breadcrumb,
heroImage: undefined
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import BlockStreamfield from './../../../components/BlockStreamfield/BlockStream
import BlockRelatedLinks from '../../../components/BlockRelatedLinks/BlockRelatedLinks.vue'
import HeroLarge from './../../../components/HeroLarge/HeroLarge.vue'
import NavJumpMenu from './../../../components/NavJumpMenu/NavJumpMenu.vue'
import NavSecondary from './../../../components/NavSecondary/NavSecondary.vue'
import MetaPanel from '../../../components/MetaPanel/MetaPanel.vue'
import ShareButtonsEdu from '../../../components/ShareButtonsEdu/ShareButtonsEdu.vue'

Expand Down Expand Up @@ -39,9 +40,9 @@ const heroInline = computed((): boolean => {
})

const computedClass = computed((): string => {
if (heroInline.value || !data?.heroImage) {
if ((heroInline.value || !data?.heroImage) && !data?.breadcrumb) {
return 'pt-5 lg:pt-12'
} else if (!heroInline.value) {
} else if (!heroInline.value || data?.breadcrumb) {
return '-nav-offset'
}
return ''
Expand All @@ -63,8 +64,16 @@ const computedClass = computed((): string => {
:class="!data.showMetaPanel ? 'mb-10' : ''"
/>

<!-- secondary nav -->
<NavSecondary
v-if="data.breadcrumb"
class="mb-10"
:breadcrumb="data.breadcrumb"
:has-intro="data.heroImage && !heroInline ? true : false"
/>

<NavJumpMenu
v-if="data.showJumpMenu"
v-if="data.showJumpMenu && !data.breadcrumb"
ref="PageEduCollectionsDetailJumpMenu"
:title="data.title"
:blocks="data.body"
Expand Down Expand Up @@ -97,8 +106,8 @@ const computedClass = computed((): string => {
:primary-subject="data.primarySubject"
:additional-subjects="data.additionalSubjects"
:grade-levels="data.gradeLevels"
:negative-top="!heroInline"
:negative-bottom="heroInline"
:negative-top="!heroInline && !data.breadcrumb && data.heroImage ? true : false"
:negative-bottom="heroInline && !data.breadcrumb"
/>

<!-- TODO: put this in a component (exclude layout though) -->
Expand All @@ -115,7 +124,7 @@ const computedClass = computed((): string => {
</LayoutHelper>

<LayoutHelper
v-if="!heroInline"
v-if="!heroInline && data.heroImage"
indent="col-2"
class="mb-6 lg:mb-12"
:class="{ '-mt-4': data.showMetaPanel }"
Expand Down