@@ -47,6 +47,25 @@ const props = defineProps<{
4747 onUpdate? : () => void
4848}>()
4949
50+ // Helper function to map landing settings from prop
51+ function mapLandingSettings(settings : any ) {
52+ return {
53+ heroTitle: settings ?.heroTitle ?? ' ' ,
54+ heroSubtitle: settings ?.heroSubtitle ?? ' ' ,
55+ eventDetailsTitle: settings ?.eventDetailsTitle ?? ' ' ,
56+ eventDetailsContent: settings ?.eventDetailsContent ?? ' ' ,
57+ miscellaneousVisible: settings ?.miscellaneousVisible ?? false ,
58+ miscellaneousTitle: settings ?.miscellaneousTitle ?? ' ' ,
59+ miscellaneousSubtitle: settings ?.miscellaneousSubtitle ?? ' ' ,
60+ faqVisible: settings ?.faqVisible ?? false ,
61+ faqEmail: settings ?.faqEmail ?? ' ' ,
62+ instagramVisible: settings ?.instagramVisible ?? false ,
63+ instagramUrl: settings ?.instagramUrl ?? ' ' ,
64+ facebookVisible: settings ?.facebookVisible ?? false ,
65+ facebookUrl: settings ?.facebookUrl ?? ' ' ,
66+ }
67+ }
68+
5069const heroImages = ref <IHeroImages []>(props .unterveranstaltung ?.landingSettings ?.heroImages ?? [])
5170
5271const unterveranstaltungId = props .unterveranstaltung ?.id
@@ -60,42 +79,14 @@ const miscellaneousItems = ref<IMiscellaneousItem[]>(
6079
6180const showNotification = ref (false )
6281
63- const landingSettings = ref ({
64- heroTitle: props .unterveranstaltung ?.landingSettings ?.heroTitle ?? ' ' ,
65- heroSubtitle: props .unterveranstaltung ?.landingSettings ?.heroSubtitle ?? ' ' ,
66- eventDetailsTitle: props .unterveranstaltung ?.landingSettings ?.eventDetailsTitle ?? ' ' ,
67- eventDetailsContent: props .unterveranstaltung ?.landingSettings ?.eventDetailsContent ?? ' ' ,
68- miscellaneousVisible: props .unterveranstaltung ?.landingSettings ?.miscellaneousVisible ?? false ,
69- miscellaneousTitle: props .unterveranstaltung ?.landingSettings ?.miscellaneousTitle ?? ' ' ,
70- miscellaneousSubtitle: props .unterveranstaltung ?.landingSettings ?.miscellaneousSubtitle ?? ' ' ,
71- faqVisible: props .unterveranstaltung ?.landingSettings ?.faqVisible ?? false ,
72- faqEmail: props .unterveranstaltung ?.landingSettings ?.faqEmail ?? ' ' ,
73- instagramVisible: props .unterveranstaltung ?.landingSettings ?.instagramVisible ?? false ,
74- instagramUrl: props .unterveranstaltung ?.landingSettings ?.instagramUrl ?? ' ' ,
75- facebookVisible: props .unterveranstaltung ?.landingSettings ?.facebookVisible ?? false ,
76- facebookUrl: props .unterveranstaltung ?.landingSettings ?.facebookUrl ?? ' ' ,
77- })
82+ const landingSettings = ref (mapLandingSettings (props .unterveranstaltung ?.landingSettings ))
7883
7984// Watch for prop changes and update local state
8085watch (
8186 () => props .unterveranstaltung ?.landingSettings ,
8287 (newSettings ) => {
8388 if (newSettings ) {
84- landingSettings .value = {
85- heroTitle: newSettings .heroTitle ?? ' ' ,
86- heroSubtitle: newSettings .heroSubtitle ?? ' ' ,
87- eventDetailsTitle: newSettings .eventDetailsTitle ?? ' ' ,
88- eventDetailsContent: newSettings .eventDetailsContent ?? ' ' ,
89- miscellaneousVisible: newSettings .miscellaneousVisible ?? false ,
90- miscellaneousTitle: newSettings .miscellaneousTitle ?? ' ' ,
91- miscellaneousSubtitle: newSettings .miscellaneousSubtitle ?? ' ' ,
92- faqVisible: newSettings .faqVisible ?? false ,
93- faqEmail: newSettings .faqEmail ?? ' ' ,
94- instagramVisible: newSettings .instagramVisible ?? false ,
95- instagramUrl: newSettings .instagramUrl ?? ' ' ,
96- facebookVisible: newSettings .facebookVisible ?? false ,
97- facebookUrl: newSettings .facebookUrl ?? ' ' ,
98- }
89+ landingSettings .value = mapLandingSettings (newSettings )
9990 heroImages .value = newSettings .heroImages ?? []
10091 miscellaneousItems .value = newSettings .miscellaneousItems ?? []
10192 deletedHeroImagesIds .value = []
0 commit comments