miss change

This commit is contained in:
Layne 2021-07-25 01:50:29 -04:00
parent 9594843e2e
commit ba63351b8a
7 changed files with 636 additions and 167 deletions

View File

@ -89,8 +89,20 @@
], ],
"hotelview": { "hotelview": {
"widgets": { "widgets": {
"types": "news,", "slot.1.widget": "promoarticle",
"slot1": "news" "slot.1.conf": "",
"slot.2.widget": "",
"slot.2.conf": "",
"slot.3.widget": "",
"slot.3.conf": "",
"slot.4.widget": "",
"slot.4.conf": "",
"slot.5.widget": "",
"slot.5.conf": "",
"slot.6.widget": "achievementcompetition_hall_of_fame",
"slot.6.conf": "",
"slot.7.widget": "",
"slot.7.conf": ""
}, },
"images": { "images": {
"background": "${asset.url}/images/reception/stretch_blue.png", "background": "${asset.url}/images/reception/stretch_blue.png",
@ -460,262 +472,682 @@
], ],
"camera.available.effects": [ "camera.available.effects": [
{ {
"name":"dark_sepia", "name": "dark_sepia",
"colorMatrix": [0.4, 0.4, 0.1, 0, 110, 0.3, 0.4, 0.1, 0, 30, 0.3, 0.2, 0.1, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
0.4,
0.4,
0.1,
0,
110,
0.3,
0.4,
0.1,
0,
30,
0.3,
0.2,
0.1,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 0, "minLevel": 0,
"enabled": true "enabled": true
}, },
{ {
"name":"increase_saturation", "name": "increase_saturation",
"colorMatrix": [2, -0.5, -0.5, 0, 0, -0.5, 2, -0.5, 0, 0, -0.5, -0.5, 2, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
2,
-0.5,
-0.5,
0,
0,
-0.5,
2,
-0.5,
0,
0,
-0.5,
-0.5,
2,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 0, "minLevel": 0,
"enabled": true "enabled": true
}, },
{ {
"name":"increase_contrast", "name": "increase_contrast",
"colorMatrix": [1.5, 0, 0, 0, -50, 0, 1.5, 0, 0, -50, 0, 0, 1.5, 0, -50, 0, 0, 0, 1.5, 0], "colorMatrix": [
1.5,
0,
0,
0,
-50,
0,
1.5,
0,
0,
-50,
0,
0,
1.5,
0,
-50,
0,
0,
0,
1.5,
0
],
"minLevel": 0, "minLevel": 0,
"enabled": true "enabled": true
}, },
{ {
"name":"shadow_multiply_02", "name": "shadow_multiply_02",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 0, "minLevel": 0,
"blendMode": 2, "blendMode": 2,
"enabled": true "enabled": true
}, },
{ {
"name":"color_1", "name": "color_1",
"colorMatrix": [0.393, 0.769, 0.189, 0, 0, 0.349, 0.686, 0.168, 0, 0, 0.272, 0.534, 0.131, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
0.393,
0.769,
0.189,
0,
0,
0.349,
0.686,
0.168,
0,
0,
0.272,
0.534,
0.131,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 1, "minLevel": 1,
"enabled": true "enabled": true
}, },
{ {
"name":"hue_bright_sat", "name": "hue_bright_sat",
"colorMatrix": [1, 0.6, 0.2, 0, -50, 0.2, 1, 0.6, 0, -50, 0.6, 0.2, 1, 0, -50, 0, 0, 0, 1, 0], "colorMatrix": [
1,
0.6,
0.2,
0,
-50,
0.2,
1,
0.6,
0,
-50,
0.6,
0.2,
1,
0,
-50,
0,
0,
0,
1,
0
],
"minLevel": 1, "minLevel": 1,
"enabled": true "enabled": true
}, },
{ {
"name":"hearts_hardlight_02", "name": "hearts_hardlight_02",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 1, "minLevel": 1,
"blendMode": 9, "blendMode": 9,
"enabled": true "enabled": true
}, },
{ {
"name":"texture_overlay", "name": "texture_overlay",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 1, "minLevel": 1,
"blendMode": 4, "blendMode": 4,
"enabled": true "enabled": true
}, },
{ {
"name":"pinky_nrm", "name": "pinky_nrm",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 1, "minLevel": 1,
"blendMode": 0, "blendMode": 0,
"enabled": true "enabled": true
}, },
{ {
"name":"color_2", "name": "color_2",
"colorMatrix": [0.333, 0.333, 0.333, 0, 0, 0.333, 0.333, 0.333, 0, 0, 0.333, 0.333, 0.333, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
0.333,
0.333,
0.333,
0,
0,
0.333,
0.333,
0.333,
0,
0,
0.333,
0.333,
0.333,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 2, "minLevel": 2,
"enabled": true "enabled": true
}, },
{ {
"name":"night_vision", "name": "night_vision",
"colorMatrix": [0, 0, 0, 0, 0, 0, 1.1, 0, 0, -50, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
0,
0,
0,
0,
0,
0,
1.1,
0,
0,
-50,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 2, "minLevel": 2,
"enabled": true "enabled": true
}, },
{ {
"name":"stars_hardlight_02", "name": "stars_hardlight_02",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 2, "minLevel": 2,
"blendMode": 9, "blendMode": 9,
"enabled": true "enabled": true
}, },
{ {
"name":"coffee_mpl", "name": "coffee_mpl",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 2, "minLevel": 2,
"blendMode": 2, "blendMode": 2,
"enabled": true "enabled": true
}, },
{ {
"name":"security_hardlight", "name": "security_hardlight",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 3, "minLevel": 3,
"blendMode": 9, "blendMode": 9,
"enabled": true "enabled": true
}, },
{ {
"name":"bluemood_mpl", "name": "bluemood_mpl",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 3, "minLevel": 3,
"blendMode": 2, "blendMode": 2,
"enabled": true "enabled": true
}, },
{ {
"name":"rusty_mpl", "name": "rusty_mpl",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 3, "minLevel": 3,
"blendMode": 2, "blendMode": 2,
"enabled": true "enabled": true
}, },
{ {
"name":"decr_conrast", "name": "decr_conrast",
"colorMatrix": [0.5, 0, 0, 0, 50, 0, 0.5, 0, 0, 50, 0, 0, 0.5, 0, 50, 0, 0, 0, 1, 0], "colorMatrix": [
0.5,
0,
0,
0,
50,
0,
0.5,
0,
0,
50,
0,
0,
0.5,
0,
50,
0,
0,
0,
1,
0
],
"minLevel": 4, "minLevel": 4,
"enabled": true "enabled": true
}, },
{ {
"name":"green_2", "name": "green_2",
"colorMatrix": [0.5, 0.5, 0.5, 0, 0, 0.5, 0.5, 0.5, 0, 90, 0.5, 0.5, 0.5, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
0.5,
0.5,
0.5,
0,
0,
0.5,
0.5,
0.5,
0,
90,
0.5,
0.5,
0.5,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 4, "minLevel": 4,
"enabled": true "enabled": true
}, },
{ {
"name":"alien_hrd", "name": "alien_hrd",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 4, "minLevel": 4,
"blendMode": 9, "blendMode": 9,
"enabled": true "enabled": true
}, },
{ {
"name":"color_3", "name": "color_3",
"colorMatrix": [0.609, 0.609, 0.082, 0, 0, 0.309, 0.609, 0.082, 0, 0, 0.309, 0.609, 0.082, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
0.609,
0.609,
0.082,
0,
0,
0.309,
0.609,
0.082,
0,
0,
0.309,
0.609,
0.082,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 5, "minLevel": 5,
"enabled": true "enabled": true
}, },
{ {
"name":"color_4", "name": "color_4",
"colorMatrix": [0.8, -0.8, 1, 0, 70, 0.8, -0.8, 1, 0, 70, 0.8, -0.8, 1, 0, 70, 0, 0, 0, 1, 0], "colorMatrix": [
0.8,
-0.8,
1,
0,
70,
0.8,
-0.8,
1,
0,
70,
0.8,
-0.8,
1,
0,
70,
0,
0,
0,
1,
0
],
"minLevel": 5, "minLevel": 5,
"enabled": true "enabled": true
}, },
{ {
"name":"toxic_hrd", "name": "toxic_hrd",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 5, "minLevel": 5,
"blendMode": 9, "blendMode": 9,
"enabled": true "enabled": true
}, },
{ {
"name":"hypersaturated", "name": "hypersaturated",
"colorMatrix": [2, -1, 0, 0, 0, -1, 2, 0, 0, 0, 0, -1, 2, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
2,
-1,
0,
0,
0,
-1,
2,
0,
0,
0,
0,
-1,
2,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 6, "minLevel": 6,
"enabled": true "enabled": true
}, },
{ {
"name":"Yellow", "name": "Yellow",
"colorMatrix": [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
1,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 6, "minLevel": 6,
"enabled": true "enabled": true
}, },
{ {
"name":"misty_hrd", "name": "misty_hrd",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 6, "minLevel": 6,
"blendMode": 9, "blendMode": 9,
"enabled": true "enabled": true
}, },
{ {
"name":"x_ray", "name": "x_ray",
"colorMatrix": [0, 1.2, 0, 0, -100, 0, 2, 0, 0, -120, 0, 2, 0, 0, -120, 0, 0, 0, 1, 0], "colorMatrix": [
0,
1.2,
0,
0,
-100,
0,
2,
0,
0,
-120,
0,
2,
0,
0,
-120,
0,
0,
0,
1,
0
],
"minLevel": 7, "minLevel": 7,
"enabled": true "enabled": true
}, },
{ {
"name":"decrease_saturation", "name": "decrease_saturation",
"colorMatrix": [0.7, 0.2, 0.2, 0, 0, 0.2, 0.7, 0.2, 0, 0, 0.2, 0.2, 0.7, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
0.7,
0.2,
0.2,
0,
0,
0.2,
0.7,
0.2,
0,
0,
0.2,
0.2,
0.7,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 7, "minLevel": 7,
"enabled": true "enabled": true
}, },
{ {
"name":"drops_mpl", "name": "drops_mpl",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 8, "minLevel": 8,
"blendMode": 2, "blendMode": 2,
"enabled": true "enabled": true
}, },
{ {
"name":"shiny_hrd", "name": "shiny_hrd",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 9, "minLevel": 9,
"blendMode": 9, "blendMode": 9,
"enabled": true "enabled": true
}, },
{ {
"name":"glitter_hrd", "name": "glitter_hrd",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 10, "minLevel": 10,
"blendMode": 9, "blendMode": 9,
"enabled": true "enabled": true
}, },
{ {
"name":"frame_gold", "name": "frame_gold",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 10, "minLevel": 10,
"blendMode": 0, "blendMode": 0,
"enabled": true "enabled": true
}, },
{ {
"name":"frame_gray_4", "name": "frame_gray_4",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 10, "minLevel": 10,
"blendMode": 0, "blendMode": 0,
"enabled": true "enabled": true
}, },
{ {
"name":"frame_black_2", "name": "frame_black_2",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 10, "minLevel": 10,
"blendMode": 0, "blendMode": 0,
"enabled": true "enabled": true
}, },
{ {
"name":"frame_wood_2", "name": "frame_wood_2",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 10, "minLevel": 10,
"blendMode": 0, "blendMode": 0,
"enabled": true "enabled": true
}, },
{ {
"name":"finger_nrm", "name": "finger_nrm",
"colorMatrix": [], "colorMatrix": [],
"minLevel": 10, "minLevel": 10,
"blendMode": 0, "blendMode": 0,
"enabled": true "enabled": true
}, },
{ {
"name":"color_5", "name": "color_5",
"colorMatrix": [3.309, 0.609, 1.082, 0.2, 0, 0.309, 0.609, 0.082, 0, 0, 1.309, 0.609, 0.082, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
3.309,
0.609,
1.082,
0.2,
0,
0.309,
0.609,
0.082,
0,
0,
1.309,
0.609,
0.082,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 10, "minLevel": 10,
"enabled": true "enabled": true
}, },
{ {
"name":"black_white_negative", "name": "black_white_negative",
"colorMatrix": [-0.5, -0.5, -0.5, 0, 0, -0.5, -0.5, -0.5, 0, 0, -0.5, -0.5, -0.5, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
-0.5,
-0.5,
-0.5,
0,
0,
-0.5,
-0.5,
-0.5,
0,
0,
-0.5,
-0.5,
-0.5,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 10, "minLevel": 10,
"enabled": true "enabled": true
}, },
{ {
"name":"blue", "name": "blue",
"colorMatrix": [0.5, 0.5, 0.5, 0, -255, 0.5, 0.5, 0.5, 0, -170, 0.5, 0.5, 0.5, 0, 0, 0, 0, 0, 1, 0], "colorMatrix": [
0.5,
0.5,
0.5,
0,
-255,
0.5,
0.5,
0.5,
0,
-170,
0.5,
0.5,
0.5,
0,
0,
0,
0,
0,
1,
0
],
"minLevel": 10, "minLevel": 10,
"enabled": true "enabled": true
}, },
{ {
"name":"red", "name": "red",
"colorMatrix": [0.5, 0.5, 0.5, 0, 0, 0.5, 0.5, 0.5, 0, -170, 0.5, 0.5, 0.5, 0, -170, 0, 0, 0, 1, 0], "colorMatrix": [
0.5,
0.5,
0.5,
0,
0,
0.5,
0.5,
0.5,
0,
-170,
0.5,
0.5,
0.5,
0,
-170,
0,
0,
0,
1,
0
],
"minLevel": 10, "minLevel": 10,
"enabled": true "enabled": true
}, },
{ {
"name":"green", "name": "green",
"colorMatrix": [0.5, 0.5, 0.5, 0, -170, 0.5, 0.5, 0.5, 0, 0, 0.5, 0.5, 0.5, 0, -170, 0, 0, 0, 1, 0], "colorMatrix": [
0.5,
0.5,
0.5,
0,
-170,
0.5,
0.5,
0.5,
0,
0,
0.5,
0.5,
0.5,
0,
-170,
0,
0,
0,
1,
0
],
"minLevel": 10, "minLevel": 10,
"enabled": true "enabled": true
} }

View File

@ -4,6 +4,7 @@
width: 100%; width: 100%;
height: calc(100% - 55px); height: calc(100% - 55px);
background: rgba($black, 1); background: rgba($black, 1);
color:#000;
.avatar-image { .avatar-image {
bottom: 12px; bottom: 12px;
@ -13,6 +14,7 @@
} }
.background { .background {
top:0;
height: 100%; height: 100%;
width: 100%; width: 100%;
background-position: left; background-position: left;
@ -74,58 +76,20 @@
background-position: right top; background-position: right top;
} }
.landing-widgets {
z-index: 9;
position: relative;
}
.widget-slot { .widget-slot {
position:absolute; z-index: 9;
z-index: 4;
overflow: hidden;
} }
.slot-1 { hr {
top: 5px; background: $black;
left: 10px; box-shadow: 0 1px rgba($white,.5);
width: 100%; opacity: 0.5
height: 100px;
}
.slot-2 {
top: 100px;
left: 100px;
width: 200px;
height:100px;
}
.slot-3 {
top: 300px;
left: 100px;
width: 200px;
height: 100px;
}
.slot-4 {
top: 100px;
left: 600px;
width: 200px;
height: 100px;
}
.slot-5 {
top: 300px;
left: 600px;
width: 200px;
height: 100px;
}
.slot-6 {
left: 10px;
bottom: 5px;
width: 100%;
height: 100px;
}
.slot-7 {
width: 100px;
height: 100%;
right: 5px;
} }
} }

View File

@ -38,13 +38,56 @@ export const HotelView: FC<HotelViewProps> = props =>
return ( return (
<div className="nitro-hotel-view" style={(backgroundColor && backgroundColor) ? { background: backgroundColor } : {}}> <div className="nitro-hotel-view" style={(backgroundColor && backgroundColor) ? { background: backgroundColor } : {}}>
{Array.from(Array(widgetSlotCount)).map((x, index) => <div className="container h-100 py-3 overflow-hidden landing-widgets">
<div className="row h-100">
<div className="col-9 h-100 d-flex flex-column">
<WidgetSlotView <WidgetSlotView
slot={index + 1} widgetSlot={ 1 }
widgetType={GetConfiguration('hotelview')['widgets']['slot.' + (index + 1) + '.widget']} widgetType={GetConfiguration('hotelview')['widgets']['slot.' + 1 + '.widget']}
widgetConf={GetConfiguration('hotelview')['widgets']['slot.' + (index + 1) +'.conf']} widgetConf={GetConfiguration('hotelview')['widgets']['slot.' + 1 +'.conf']}
key={index.toString()} />
/>)} <div className="row mx-0">
<WidgetSlotView
widgetSlot={ 2 }
widgetType={GetConfiguration('hotelview')['widgets']['slot.' + 2 + '.widget']}
widgetConf={GetConfiguration('hotelview')['widgets']['slot.' + 2 + '.conf']}
className="col-6"
/>
<WidgetSlotView
widgetSlot={ 3 }
widgetType={GetConfiguration('hotelview')['widgets']['slot.' + 3 + '.widget']}
widgetConf={GetConfiguration('hotelview')['widgets']['slot.' + 3 + '.conf']}
className="col-6"
/>
<WidgetSlotView
widgetSlot={ 4 }
widgetType={GetConfiguration('hotelview')['widgets']['slot.' + 4 + '.widget']}
widgetConf={GetConfiguration('hotelview')['widgets']['slot.' + 4 + '.conf']}
className="col-6"
/>
<WidgetSlotView
widgetSlot={ 5 }
widgetType={GetConfiguration('hotelview')['widgets']['slot.' + 5 + '.widget']}
widgetConf={GetConfiguration('hotelview')['widgets']['slot.' + 5 + '.conf']}
className="col-6"
/>
</div>
<WidgetSlotView
widgetSlot={ 6 }
widgetType={GetConfiguration('hotelview')['widgets']['slot.' + 6 + '.widget']}
widgetConf={GetConfiguration('hotelview')['widgets']['slot.' + 6 + '.conf']}
className="mt-auto"
/>
</div>
<div className="col-3 h-100">
<WidgetSlotView
widgetSlot={ 7 }
widgetType={GetConfiguration('hotelview')['widgets']['slot.' + 7 + '.widget']}
widgetConf={GetConfiguration('hotelview')['widgets']['slot.' + 7 +'.conf']}
/>
</div>
</div>
</div>
<div className="background position-absolute" style={(background && background.length) ? { backgroundImage: `url(${background})` } : {}} /> <div className="background position-absolute" style={(background && background.length) ? { backgroundImage: `url(${background})` } : {}} />
<div className="sun position-absolute" style={(sun && sun.length) ? { backgroundImage: `url(${sun})` } : {}} /> <div className="sun position-absolute" style={(sun && sun.length) ? { backgroundImage: `url(${sun})` } : {}} />
<div className="drape position-absolute" style={(drape && drape.length) ? { backgroundImage: `url(${drape})` } : {}} /> <div className="drape position-absolute" style={(drape && drape.length) ? { backgroundImage: `url(${drape})` } : {}} />

View File

@ -4,9 +4,11 @@ import { WidgetSlotViewProps } from './WidgetSlotView.types';
export const WidgetSlotView: FC<WidgetSlotViewProps> = props => export const WidgetSlotView: FC<WidgetSlotViewProps> = props =>
{ {
const { widgetType = null, widgetSlot = 0, widgetConf = null, className= '', ...rest } = props;
return ( return (
<div className={"widget-slot slot-" + props.slot}> <div className={`widget-slot slot-${widgetSlot} ${(className || '')}`} { ...rest }>
<GetWidgetLayout widgetType={props.widgetType} slot={props.slot} widgetConf={props.widgetConf} /> <GetWidgetLayout widgetType={widgetType} slot={widgetSlot} widgetConf={widgetConf} />
</div> </div>
); );
} }

View File

@ -1,6 +1,8 @@
export interface WidgetSlotViewProps import { DetailsHTMLAttributes } from 'react';
export interface WidgetSlotViewProps extends DetailsHTMLAttributes<HTMLDivElement>
{ {
widgetType: string; widgetType: string;
slot: number; widgetSlot: number;
widgetConf: string; widgetConf: string;
} }

View File

@ -1,4 +1,27 @@
.promo-article { .promo-articles {
width: 100%; width: 100%;
height: 100%; height: 100%;
.promo-articles-bullet {
border-radius: 50%;
background-color: $white;
border: 1px solid $white;
height: 13px;
width: 13px;
margin-right: 3px;
&.promo-articles-bullet-active {
background: $black;
}
}
.promo-article {
.promo-article-image {
width: 150px;
height: 150px;
margin-right: 10px;
background-repeat: no-repeat;
background-position: top center;
}
}
} }

View File

@ -1,7 +1,7 @@
import { GetPromoArticlesComposer, PromoArticleData, PromoArticlesMessageEvent } from 'nitro-renderer'; import { GetPromoArticlesComposer, PromoArticleData, PromoArticlesMessageEvent } from 'nitro-renderer';
import { FC, useCallback, useEffect, useState } from 'react'; import { FC, useCallback, useEffect, useState } from 'react';
import { Carousel } from 'react-bootstrap';
import { CreateMessageHook, SendMessageHook } from '../../../../../hooks'; import { CreateMessageHook, SendMessageHook } from '../../../../../hooks';
import { LocalizeText } from '../../../../../utils/LocalizeText';
import { PromoArticleWidgetViewProps } from './PromoArticleWidgetView.types'; import { PromoArticleWidgetViewProps } from './PromoArticleWidgetView.types';
export const PromoArticleWidgetView: FC<PromoArticleWidgetViewProps> = props => export const PromoArticleWidgetView: FC<PromoArticleWidgetViewProps> = props =>
@ -9,7 +9,7 @@ export const PromoArticleWidgetView: FC<PromoArticleWidgetViewProps> = props =>
const [articles, setArticles] = useState<PromoArticleData[]>(null); const [articles, setArticles] = useState<PromoArticleData[]>(null);
const [index, setIndex] = useState(0); const [index, setIndex] = useState(0);
const handleSelect = (selectedIndex, e) => const handleSelect = (selectedIndex) =>
{ {
setIndex(selectedIndex); setIndex(selectedIndex);
}; };
@ -30,22 +30,25 @@ export const PromoArticleWidgetView: FC<PromoArticleWidgetViewProps> = props =>
if (!articles) return null; if (!articles) return null;
return ( return (
<div className="promo-article widget"> <div className="promo-articles widget">
<Carousel activeIndex={index} onSelect={handleSelect}> <div className="d-flex flex-row align-items-center w-100 mb-1">
{articles && (articles.length > 0) && articles.map(article => <small className="flex-shrink-0 pe-1">{ LocalizeText('landing.view.promo.article.header') }</small>
<Carousel.Item key={article.id.toString()}> <hr className="w-100 my-0"/>
<img </div>
className="d-block" <div className="d-flex flex-row mb-1">
src={article.imageUrl} {articles && (articles.length > 0) && articles.map((article, ind) =>
alt={article.title} <div className={`promo-articles-bullet ` + (article === articles[index] ? 'promo-articles-bullet-active' : '')} key={article.id} onClick={event => handleSelect(ind)} />
/>
<Carousel.Caption>
<h3>{article.title}</h3>
<p>{article.bodyText}</p>
</Carousel.Caption>
</Carousel.Item>
)} )}
</Carousel> </div>
{articles && articles[index] &&
<div className="promo-article d-flex flex-row row mx-0">
<div className="promo-article-image" style={ {backgroundImage: `url(${articles[index].imageUrl})`} }/>
<div className="col-3">
<h3 className="my-0">{articles[index].title}</h3>
<b>{ articles[index].bodyText }</b>
</div>
</div>
}
</div> </div>
); );
} }