From de785861fe5510d5ad5957adcf4888560e17c745 Mon Sep 17 00:00:00 2001 From: Vitalii8 Date: Fri, 2 Feb 2024 11:08:06 +0100 Subject: [PATCH] fix: added mediaView to Banner-block schema (#801) --- src/blocks/Banner/schema.ts | 5 +++++ src/blocks/Header/schema.ts | 3 ++- src/schema/validators/common.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/blocks/Banner/schema.ts b/src/blocks/Banner/schema.ts index 921678d36..110bc6d7c 100644 --- a/src/blocks/Banner/schema.ts +++ b/src/blocks/Banner/schema.ts @@ -3,6 +3,7 @@ import { BaseProps, ButtonBlock, ThemeProps, + mediaView, withTheme, } from '../../schema/validators/common'; @@ -23,6 +24,10 @@ export const BannerCardProps = { image: withTheme({ type: 'string', }), + mediaView: { + type: 'string', + enum: mediaView, + }, disableCompress: { type: 'boolean', }, diff --git a/src/blocks/Header/schema.ts b/src/blocks/Header/schema.ts index 9ee8484ed..613c5f61a 100644 --- a/src/blocks/Header/schema.ts +++ b/src/blocks/Header/schema.ts @@ -4,6 +4,7 @@ import { ButtonBlock, MediaProps, VideoProps, + mediaView, withTheme, } from '../../schema/validators/common'; import {filteredArray} from '../../schema/validators/utils'; @@ -46,7 +47,7 @@ export const HeaderProperties = { video: withTheme(VideoProps), mediaView: { type: 'string', - enum: ['fit', 'full'], + enum: mediaView, }, backLink: { type: 'object', diff --git a/src/schema/validators/common.ts b/src/schema/validators/common.ts index c904be5cc..fb00c8ccf 100644 --- a/src/schema/validators/common.ts +++ b/src/schema/validators/common.ts @@ -27,6 +27,7 @@ export const dividerEnum = {enum: ['0', 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', export const sizeNumber = {type: 'number', maximum: 12, minimum: 1}; export const contentThemes = ['default', 'dark', 'light']; export const quoteTypes = Object.values(QuoteType); +export const mediaView = ['fit', 'full']; export const customControlsType = [ CustomControlsType.WithMuteButton, CustomControlsType.WithPlayPauseButton,