diff --git a/public/configuration.json b/public/configuration.json index 8d638a23..4a81f531 100644 --- a/public/configuration.json +++ b/public/configuration.json @@ -91,8 +91,8 @@ "widgets": { "slot.1.widget": "promoarticle", "slot.1.conf": "", - "slot.2.widget": "", - "slot.2.conf": "", + "slot.2.widget": "widgetcontainer", + "slot.2.conf": "image:${image.library.url}web_promo_small/spromo_Canal_Bundle.png,btn:HelloHELLO,btnLink:https://google.com/", "slot.3.widget": "", "slot.3.conf": "", "slot.4.widget": "", diff --git a/src/assets/styles/bootstrap/_variables.scss b/src/assets/styles/bootstrap/_variables.scss index 1d1de900..0fd0eeb4 100644 --- a/src/assets/styles/bootstrap/_variables.scss +++ b/src/assets/styles/bootstrap/_variables.scss @@ -80,6 +80,7 @@ $cello-light: #21516e !default; $cello-dark: #1e465e !default; $pale-sky: #677181 !default; $oslo-gray: #8F9297 !default; +$gainsboro: #d9d9d9 !default; $success: $green !default; $info: $cyan !default; @@ -122,7 +123,8 @@ $theme-colors: ( "white": $white, "black": $black, "muted": $muted, - "purple": $purple + "purple": $purple, + "gainsboro": $gainsboro ) !default; // scss-docs-end theme-colors-map diff --git a/src/views/hotel-view/HotelView.scss b/src/views/hotel-view/HotelView.scss index c4973317..1c719e38 100644 --- a/src/views/hotel-view/HotelView.scss +++ b/src/views/hotel-view/HotelView.scss @@ -95,3 +95,4 @@ @import './views/widgets/promo-article/PromoArticleWidgetView.scss'; @import './views/widgets/bonus-rare/BonusRareWidgetView.scss'; +@import './views/widgets/widgetcontainer/WidgetContainerView.scss' diff --git a/src/views/hotel-view/HotelView.tsx b/src/views/hotel-view/HotelView.tsx index 6d1e3f3e..e870654e 100644 --- a/src/views/hotel-view/HotelView.tsx +++ b/src/views/hotel-view/HotelView.tsx @@ -44,9 +44,10 @@ export const HotelView: FC = props => -
+
= props => { @@ -14,6 +15,8 @@ export const GetWidgetLayout: FC = props => return ; case "bonusrare": return ; + case "widgetcontainer": + return default: return null; } diff --git a/src/views/hotel-view/views/widgets/promo-article/PromoArticleWidgetView.tsx b/src/views/hotel-view/views/widgets/promo-article/PromoArticleWidgetView.tsx index a9dc0ca9..5b110db6 100644 --- a/src/views/hotel-view/views/widgets/promo-article/PromoArticleWidgetView.tsx +++ b/src/views/hotel-view/views/widgets/promo-article/PromoArticleWidgetView.tsx @@ -37,15 +37,16 @@ export const PromoArticleWidgetView: FC = props =>
{articles && (articles.length > 0) && articles.map((article, ind) => -
handleSelect(ind)} /> +
handleSelect(ind)} /> )}
{articles && articles[index] &&
-
+

{articles[index].title}

{ articles[index].bodyText } +
} diff --git a/src/views/hotel-view/views/widgets/widgetcontainer/WIdgetContainerView.tsx b/src/views/hotel-view/views/widgets/widgetcontainer/WIdgetContainerView.tsx new file mode 100644 index 00000000..d8a903ef --- /dev/null +++ b/src/views/hotel-view/views/widgets/widgetcontainer/WIdgetContainerView.tsx @@ -0,0 +1,47 @@ +import { FC, useCallback, useMemo } from 'react'; +import { GetConfigurationManager } from '../../../../../api/core/'; +import { WidgetContainerViewProps } from './WidgetContainerView.types'; + +export const WidgetContainerView: FC = props => +{ + const { conf = null } = props; + + const config = useMemo(() => + { + const config = {}; + + if(!conf || !conf.length) return config; + + let options = conf.split(","); + + options.forEach(option => + { + let [ key, value ] = option.split(':'); + + if(key && value) config[key] = value; + }); + + return config; + }, [ conf ]); + + const getOption = useCallback((key: string) => + { + const option = config[key]; + + if(!option) return null; + + switch(key) + { + case 'image': + return GetConfigurationManager().interpolate(option); + } + + return option; + }, [ config ]); + + return ( +
+ { getOption('image') } +
+ ); +} diff --git a/src/views/hotel-view/views/widgets/widgetcontainer/WidgetContainerView.scss b/src/views/hotel-view/views/widgets/widgetcontainer/WidgetContainerView.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/views/hotel-view/views/widgets/widgetcontainer/WidgetContainerView.types.ts b/src/views/hotel-view/views/widgets/widgetcontainer/WidgetContainerView.types.ts new file mode 100644 index 00000000..55f5924f --- /dev/null +++ b/src/views/hotel-view/views/widgets/widgetcontainer/WidgetContainerView.types.ts @@ -0,0 +1,4 @@ +export interface WidgetContainerViewProps +{ + conf: string; +}