Skip to content

Commit 0754b12

Browse files
committed
introduced theming.headingCustomStyles allowing to specify custom styles in event heading
1 parent 3de5b87 commit 0754b12

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

cloud/functions/src/crawlers/crawler-parsers.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ export const EVENT_THEME_PARSER = z.object({
5454
secondaryContrastHex: HEX_COLOR_PARSER,
5555
tertiaryHex: HEX_COLOR_PARSER,
5656
tertiaryContrastHex: HEX_COLOR_PARSER
57-
})
57+
}),
58+
headingCustomStyles: z.object({
59+
title: z.string().nullable(),
60+
subTitle: z.string().nullable(),
61+
banner: z.string().nullable(),
62+
}).optional().nullable().default(null),
5863
})
5964

6065
export const SOCIAL_MEDIA_TYPE = z.union([

mobile/src/components/events/CurrentEventHeader.vue

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
<ion-button class="viewsHeader-back" @click="backButtonClicked" shape="round" :aria-label="LL.Back_List_Events()" data-testid="back-to-events-list">
66
<ion-icon src="/assets/icons/solid/checkbox-list.svg"></ion-icon>
77
</ion-button>
8-
<!-- TODO Connect variables custom title -->
98
<!-- NOTE (!) See how to manage the dynamic import of font familly via a URL. -->
109
<div class="viewsHeader-title">
11-
<span class="viewsHeader-name"
12-
:style="{
13-
'--voxxrin-event-theme-head-title-font-familly': 'Poppins, sans-serif',
14-
'--voxxrin-event-theme-head-title-font-weight': '700'
15-
}"
16-
>{{ confDescriptor.headingTitle }}</span>
17-
<span v-if="confDescriptor.headingSubTitle" class="viewsHeader-subTitle">{{ confDescriptor.headingSubTitle }}</span>
10+
<span class="viewsHeader-name" :style="confDescriptor.theming.headingCustomStyles?.title || ''">{{ confDescriptor.headingTitle }}</span>
11+
<span v-if="confDescriptor.headingSubTitle"
12+
:style="confDescriptor.theming.headingCustomStyles?.subTitle || ''" class="viewsHeader-subTitle"
13+
>{{ confDescriptor.headingSubTitle }}</span>
1814
</div>
1915
</div>
2016

@@ -24,9 +20,11 @@
2420
</div>
2521
</div>
2622
</ion-toolbar>
27-
<!-- TODO Connect variables custom title -->
28-
<img :src="confDescriptor.backgroundUrl" :alt="LL.Banner_Event()"
29-
:style="{ '--voxxrin-event-theme-head-background-justify': 'right'}">
23+
<img
24+
:src="confDescriptor.backgroundUrl"
25+
:alt="LL.Banner_Event()"
26+
:style="confDescriptor.theming.headingCustomStyles?.banner || ''"
27+
/>
3028
</ion-header>
3129
</template>
3230

@@ -70,7 +68,6 @@ const headingBackground = computed(() => {
7068
width: 100%;
7169
z-index: -1;
7270
object-fit: cover;
73-
object-position: var(--voxxrin-event-theme-head-background-justify);
7471
}
7572
7673
.btnUser {
@@ -108,8 +105,6 @@ const headingBackground = computed(() => {
108105
padding-top: 16px;
109106
font-weight: bold;
110107
color: var(--voxxrin-event-theme-colors-primary-contrast-hex);
111-
font-family: var(--voxxrin-event-theme-head-title-font-familly), sans-serif;
112-
font-weight: var(--voxxrin-event-theme-head-title-font-weight);
113108
114109
&-title {
115110
position: relative;
@@ -119,7 +114,6 @@ const headingBackground = computed(() => {
119114
align-content: center;
120115
justify-content: center;
121116
line-height: 1;
122-
color: white;
123117
124118
@media (min-width:768px) {
125119
position: absolute;
@@ -142,7 +136,7 @@ const headingBackground = computed(() => {
142136
.viewsHeader-name {
143137
line-height: 1;
144138
font-size: calc(26px + 16 * (100vw - 320px) / 1024);
145-
font-weight: 800;
139+
font-weight: 700;
146140
}
147141
148142
.viewsHeader-subTitle {

mobile/src/models/VoxxrinEvent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,6 @@ export function toVoxxrinEventTheme(firestoreTheme: EventTheme): VoxxrinEventThe
117117
tertiaryRGB: hexToRGB(firestoreTheme.colors.tertiaryHex),
118118
tertiaryContrastRGB: hexToRGB(firestoreTheme.colors.tertiaryContrastHex),
119119
},
120+
headingCustomStyles: firestoreTheme.headingCustomStyles,
120121
}
121122
}

shared/event-list.firestore.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ export type EventTheme = {
88
secondaryContrastHex: HexColor,
99
tertiaryHex: HexColor,
1010
tertiaryContrastHex: HexColor
11-
}
11+
},
12+
headingCustomStyles: {
13+
title: string|null,
14+
subTitle: string|null,
15+
banner: string|null,
16+
}|null,
1217
}
1318

1419
export type Day = {

0 commit comments

Comments
 (0)