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/bus 825 youtube video cms #46

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
Binary file modified bun.lockb
Binary file not shown.
21 changes: 21 additions & 0 deletions components/cms/block/CmsBlockProductThreeColumn.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script setup lang="ts">
import type { Schemas } from '@shopware/api-client/api-types';

const props = defineProps<{
block: Schemas['CmsBlock'];
}>();

const { getSlotContent } = useCmsBlock(props.block);

const leftContent: Schemas['CmsSlot'] = getSlotContent('left');
const centerContent: Schemas['CmsSlot'] = getSlotContent('center');
const rightContent: Schemas['CmsSlot'] = getSlotContent('right');
</script>

<template>
<div class="grid gap-4 md:grid-cols-3">
<CmsLoader :content="leftContent" />
<CmsLoader :content="centerContent" />
<CmsLoader :content="rightContent" />
</div>
</template>
12 changes: 12 additions & 0 deletions components/cms/block/CmsBlockYoutubeVideo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script setup lang="ts">
import type { Schemas } from '@shopware/api-client/api-types';
const props = defineProps<{
block: Schemas['CmsBlock'];
}>();
const { getSlotContent } = useCmsBlock(props.block);
const video: Schemas['CmsSlot'] = getSlotContent('video');
</script>

<template>
<CmsLoader :content="video" />
</template>
13 changes: 13 additions & 0 deletions components/cms/element/CmsElementProductBox.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script setup lang="ts">
import type { CmsElementProductBox } from '@shopware-pwa/composables-next';

const props = defineProps<{
element: CmsElementProductBox;
}>();

const { product } = useProduct(props.element.data.product);
</script>

<template>
<ProductCard :product="product"></ProductCard>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<ProductCard :product="product"></ProductCard>
<ProductCard :product="product" />

</template>
31 changes: 31 additions & 0 deletions components/cms/element/CmsElementYoutubeVideo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<script setup lang="ts">
import type { CmsElementVimeoVideo } from '@shopware-pwa/composables-next';

const props = defineProps<{
element: CmsElementVimeoVideo;
}>();

const youtubeVideo = ref(null);

const videoId = props.element.config.videoID.value
const videoUrl = computed(() => `https://www.youtube.com/embed/${videoId}`)
</script>

<template>
<div ref="youtubeVideo" class="my-0 mx-auto">
<div class="youtube-player h-full w-full relative ">
Comment on lines +15 to +16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't these two divs be combined?

<iframe
:src="videoUrl"
frameborder="0"
class="w-full h-full absolute top-0 left-0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen"
allowfullscreen
></iframe>
</div>
</div>
</template>
<style scoped>
.youtube-player{
padding-bottom: 56.25%;
}
</style>