Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix(cms): picture grid is displayed incorrectly (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
Przemek Spaczek authored May 28, 2020
1 parent 0ea9015 commit 3ab38c6
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions packages/default-theme/cms/blocks/CmsBlockImageSimpleGrid.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<template>
<article class="sw-image-simple-grid">
<section class="sw-image-simple-grid__left-images">
<CmsGenericElement :content="getLeftTopContent" class="sw-image-simple-grid__image"/>
<CmsGenericElement :content="getLeftBottomContent" class="sw-image-simple-grid__image"/>
<CmsGenericElement
:content="getLeftTopContent"
class="sw-image-simple-grid__image"
/>
<CmsGenericElement
:content="getLeftBottomContent"
class="sw-image-simple-grid__image"
/>
</section>
<CmsGenericElement :content="getRightContent" class="sw-image-simple-grid__image sw-image-simple-grid__image--right"/>
<CmsGenericElement
:content="getRightContent"
class="sw-image-simple-grid__image sw-image-simple-grid__image--right"
/>
</article>
</template>

Expand All @@ -14,35 +23,35 @@ import CmsGenericElement from 'sw-cms/CmsGenericElement'
export default {
name: 'CmsBlockImageSimpleGrid',
components: {
CmsGenericElement
CmsGenericElement,
},
props: {
content: {
type: Object,
default: () => ({})
}
default: () => ({}),
},
},
computed: {
getSlots() {
return this.content.slots || []
},
getLeftTopContent() {
return this.getSlots.find(({slot}) => slot === 'left-top')
return this.getSlots.find(({ slot }) => slot === 'left-top')
},
getLeftBottomContent() {
return this.getSlots.find(({slot}) => slot === 'left-bottom')
return this.getSlots.find(({ slot }) => slot === 'left-bottom')
},
getRightContent() {
return this.getSlots.find(({slot}) => slot === 'right')
return this.getSlots.find(({ slot }) => slot === 'right')
},
},
};
}
</script>

<style lang="scss" scoped>
@import '@/assets/scss/variables';
.sw-image-simple-grid {
::v-deep.sw-image-simple-grid {
display: flex;
flex-direction: column;
Expand All @@ -61,7 +70,7 @@ export default {
justify-content: space-around;
align-items: center;
flex-direction: row;
&__left-images {
display: flex;
flex-direction: column;
Expand All @@ -75,5 +84,4 @@ export default {
}
}
}
</style>

1 comment on commit 3ab38c6

@vercel
Copy link

@vercel vercel bot commented on 3ab38c6 May 28, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.