Skip to content

Commit 5b48042

Browse files
committed
fix: SSR: fallback if banner not setup
1 parent 96f5fcf commit 5b48042

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

resources/js/Components/CMS/Webpage/WowsbarBanner/WowsbarBannerIris.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import SliderLandscape from "@/Components/Banners/Slider/SliderLandscape.vue";
33
import SliderSquare from "@/Components/Banners/Slider/SliderSquare.vue";
44
import { getStyles } from "@/Composables/styles";
5+
import { trans } from "laravel-vue-i18n"
56
67
78
const props = defineProps<{
@@ -17,8 +18,11 @@ const props = defineProps<{
1718

1819
<template>
1920
<div :style="getStyles(fieldValue?.container?.properties)">
20-
<SliderLandscape v-if="fieldValue.compiled_layout.type === 'landscape'" :data="fieldValue.compiled_layout"
21+
<SliderLandscape v-if="fieldValue?.compiled_layout?.type === 'landscape'" :data="fieldValue.compiled_layout"
2122
:production="true" />
22-
<SliderSquare v-else :data="fieldValue.compiled_layout" :production="true" />
23+
<SliderSquare v-else-if="fieldValue?.compiled_layout?.type === 'square'" :data="fieldValue.compiled_layout" :production="true" />
24+
<div v-else class="py-4 w-full bg-gray-100 text-center text-gray-400 italic">
25+
{{ trans("Banner is empty") }}
26+
</div>
2327
</div>
2428
</template>

0 commit comments

Comments
 (0)