Skip to content

Commit

Permalink
fixing scroll margin for headings, fixing logic to hide sections when…
Browse files Browse the repository at this point in the history
… there's no content -- also fixes procedures from being hidden
  • Loading branch information
stephiescastle committed Aug 28, 2024
1 parent 442f665 commit 50af4e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/vue/src/components/BlockHeading/BlockHeading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default defineComponent({
&:target {
@apply scroll-mt-14;
@screen lg {
@apply scroll-mt-20;
@apply scroll-mt-[8rem];
}
}
}
Expand Down
29 changes: 15 additions & 14 deletions packages/vue/src/templates/edu/PageEduLesson/PageEduLesson.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => {
: undefined,
blocks: section !== 'materials' && section !== 'procedures' ? data[section] : undefined,
text: section === 'materials' ? data[section] : undefined,
procedures: section === 'procedures' ? data[section] : undefined,
procedureSteps: section === 'procedures' ? data.proceduresStepsNumbering : false
procedures: section === 'procedures' ? data[section] : undefined
})
}
// include custom "after_" sections
Expand Down Expand Up @@ -333,18 +332,20 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => {
v-for="(value, _key) in consolidatedSections"
:key="_key"
>
<BlockStreamfield
v-if="value.type === 'streamfield'"
:data="value.blocks"
/>
<PageEduLessonSection
v-else
:heading="value.heading"
:blocks="value.blocks"
:procedures="value.procedures"
:text="value.text"
:image="value.image"
/>
<template v-if="value.blocks?.length || value.procedures?.length">
<BlockStreamfield
v-if="value.type === 'streamfield'"
:data="value.blocks"
/>
<PageEduLessonSection
v-else
:heading="value.heading"
:blocks="value.blocks"
:procedures="value.procedures"
:text="value.text"
:image="value.image"
/>
</template>
</template>
<!-- streamfield blocks -->
Expand Down

0 comments on commit 50af4e8

Please sign in to comment.