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

Commit

Permalink
feat(cms): created new block for forms (#1046)
Browse files Browse the repository at this point in the history
  • Loading branch information
Malwurf authored Aug 28, 2020
1 parent 30e422c commit 253f025
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"slots",
"type",
"id",
"backgroundColor",
"backgroundMedia",
"sectionPosition"
],
Expand All @@ -71,7 +72,6 @@
"type",
"config"
],

"product": [
"media",
"productReviews",
Expand Down Expand Up @@ -153,7 +153,6 @@
"translated"
]
}

},
"useProduct": {
"associations": [
Expand Down Expand Up @@ -196,7 +195,6 @@
}
]
}

]
}
],
Expand Down
44 changes: 44 additions & 0 deletions packages/default-theme/cms/blocks/CmsBlockForms.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<template>
<CmsGenericElement
v-if="getContent"
:content="getContent"
:style="{
'background-color': getBackgroundColor,
'background-size': 'cover',
'background-repeat': 'no-repeat',
}"
class="cms-block-forms"
/>
</template>
<script>
import CmsGenericElement from "sw-cms/CmsGenericElement"
export default {
name: "CmsBlockForms",
components: {
CmsGenericElement,
},
props: {
content: {
type: Object,
default: () => ({}),
},
},
computed: {
getSlots() {
return this.content.slots || []
},
getContent() {
return this.getSlots.length && this.getSlots[0]
},
getBackgroundColor() {
return this.content.backgroundColor
},
},
}
</script>
<style lang="scss" scoped>
@import "../settings.scss";
.cms-block-forms {
@include sizing-mode-boxed;
}
</style>
2 changes: 1 addition & 1 deletion packages/default-theme/cms/cmsMap.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"text-three-column": "CmsBlockTextThreeColumn",
"product-three-column": "CmsBlockProductThreeColumn",
"text-two-column": "CmsBlockTextTwoColumn",
"form": "CmsBlockDefault"
"form": "CmsBlockForms"
},
"elements": {
"product-box": "CmsElementProductCard",
Expand Down

1 comment on commit 253f025

@vercel
Copy link

@vercel vercel bot commented on 253f025 Aug 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.