Skip to content

Commit

Permalink
fix: allowing hero videos to be inline on news pages (#712)
Browse files Browse the repository at this point in the history
* allowing hero videos to be inline on news pages

* switching logic from show to hideShareLinks

* Revert "switching logic from show to hideShareLinks"

This reverts commit 2f362a5.

* fixing BlockVideo import, adding autplay property to video data
  • Loading branch information
stephiescastle authored Dec 6, 2024
1 parent 21d95b7 commit 99daab8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export const HeroVideo = {
blockType: 'VideoBlock',
video: BaseVideoData,
caption: 'Lorem ipsum dolor sit amet',
credit: 'NASA/JPL'
credit: 'NASA/JPL',
autoplay: true
}
]
}
Expand Down
17 changes: 7 additions & 10 deletions packages/vue/src/templates/PageNewsDetail/PageNewsDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ import BlockImageStandard from './../../components/BlockImage/BlockImageStandard
import BlockLinkCarousel from './../../components/BlockLinkCarousel/BlockLinkCarousel.vue'
import ShareButtons from './../../components/ShareButtons/ShareButtons.vue'
import BlockText from './../../components/BlockText/BlockText.vue'
import BlockVideo from './../../components/BlockText/BlockText.vue'
import BlockVideo from './../../components/BlockVideo/BlockVideo.vue'
export default defineComponent({
name: 'PageNewsDetail',
Expand Down Expand Up @@ -207,16 +207,13 @@ export default defineComponent({
return (this.data?.hero || []).length === 0
},
heroInline(): boolean {
if (!this.heroEmpty) {
if (this.data?.hero[0].blockType === 'VideoBlock') {
return false
} else if (
this.data?.heroPosition === 'inline' ||
if (
!this.heroEmpty &&
(this.data?.heroPosition === 'inline' ||
this.data?.hero[0].blockType === 'CarouselBlock' ||
this.data?.hero[0].blockType === 'VideoEmbedBlock'
) {
return true
}
this.data?.hero[0].blockType === 'VideoEmbedBlock')
) {
return true
}
return false
},
Expand Down

0 comments on commit 99daab8

Please sign in to comment.