refactor: SectionWrapper
All checks were successful
Deploy WordPress and Nuxt / deploy (push) Successful in 57s

This commit is contained in:
2025-09-24 15:38:45 -04:00
parent 5c49583287
commit 1f81cb4ad8
7 changed files with 35 additions and 17 deletions

View File

@@ -1,8 +1,6 @@
fragment SectionTextBlock on GroupAbstractBuilderSectionsTextBlockLayout {
content
layoutSettings {
__typename
contentWidth
bgColor
...SectionWrapper
}
}

View File

@@ -0,0 +1,4 @@
fragment SectionWrapper on GroupAbstractBuilderSectionsLayoutSettings {
bgColor
contentWidth
}

View File

@@ -0,0 +1,13 @@
<script setup lang="ts">
import type { SectionWrapperFragment } from "#graphql-operations";
defineProps<SectionWrapperFragment>();
</script>
<template>
<section :class="bgColor">
<div :class="contentWidth">
<slot />
</div>
</section>
</template>

View File

@@ -6,5 +6,7 @@ const sections = props.sections.filter(Boolean).map((section) => useSection(sect
</script>
<template>
<component :is="component" v-for="({ component, attrs }, i) in sections" :key="i" v-bind="attrs" />
<SectionWrapper v-for="({ component, attrs }, i) in sections" :key="i" v-bind="attrs.layoutSettings || {}">
<component :is="component" v-bind="attrs" />
</SectionWrapper>
</template>