mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-18 21:36:27 +01:00
changes
This commit is contained in:
parent
ba63351b8a
commit
ff8b140ac8
@ -91,8 +91,8 @@
|
|||||||
"widgets": {
|
"widgets": {
|
||||||
"slot.1.widget": "promoarticle",
|
"slot.1.widget": "promoarticle",
|
||||||
"slot.1.conf": "",
|
"slot.1.conf": "",
|
||||||
"slot.2.widget": "",
|
"slot.2.widget": "widgetcontainer",
|
||||||
"slot.2.conf": "",
|
"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.widget": "",
|
||||||
"slot.3.conf": "",
|
"slot.3.conf": "",
|
||||||
"slot.4.widget": "",
|
"slot.4.widget": "",
|
||||||
|
@ -80,6 +80,7 @@ $cello-light: #21516e !default;
|
|||||||
$cello-dark: #1e465e !default;
|
$cello-dark: #1e465e !default;
|
||||||
$pale-sky: #677181 !default;
|
$pale-sky: #677181 !default;
|
||||||
$oslo-gray: #8F9297 !default;
|
$oslo-gray: #8F9297 !default;
|
||||||
|
$gainsboro: #d9d9d9 !default;
|
||||||
|
|
||||||
$success: $green !default;
|
$success: $green !default;
|
||||||
$info: $cyan !default;
|
$info: $cyan !default;
|
||||||
@ -122,7 +123,8 @@ $theme-colors: (
|
|||||||
"white": $white,
|
"white": $white,
|
||||||
"black": $black,
|
"black": $black,
|
||||||
"muted": $muted,
|
"muted": $muted,
|
||||||
"purple": $purple
|
"purple": $purple,
|
||||||
|
"gainsboro": $gainsboro
|
||||||
) !default;
|
) !default;
|
||||||
// scss-docs-end theme-colors-map
|
// scss-docs-end theme-colors-map
|
||||||
|
|
||||||
|
@ -95,3 +95,4 @@
|
|||||||
|
|
||||||
@import './views/widgets/promo-article/PromoArticleWidgetView.scss';
|
@import './views/widgets/promo-article/PromoArticleWidgetView.scss';
|
||||||
@import './views/widgets/bonus-rare/BonusRareWidgetView.scss';
|
@import './views/widgets/bonus-rare/BonusRareWidgetView.scss';
|
||||||
|
@import './views/widgets/widgetcontainer/WidgetContainerView.scss'
|
||||||
|
@ -44,9 +44,10 @@ export const HotelView: FC<HotelViewProps> = props =>
|
|||||||
<WidgetSlotView
|
<WidgetSlotView
|
||||||
widgetSlot={ 1 }
|
widgetSlot={ 1 }
|
||||||
widgetType={GetConfiguration('hotelview')['widgets']['slot.' + 1 + '.widget']}
|
widgetType={GetConfiguration('hotelview')['widgets']['slot.' + 1 + '.widget']}
|
||||||
widgetConf={GetConfiguration('hotelview')['widgets']['slot.' + 1 +'.conf']}
|
widgetConf={GetConfiguration('hotelview')['widgets']['slot.' + 1 + '.conf']}
|
||||||
|
className="col-6"
|
||||||
/>
|
/>
|
||||||
<div className="row mx-0">
|
<div className="col-12 row mx-0">
|
||||||
<WidgetSlotView
|
<WidgetSlotView
|
||||||
widgetSlot={ 2 }
|
widgetSlot={ 2 }
|
||||||
widgetType={GetConfiguration('hotelview')['widgets']['slot.' + 2 + '.widget']}
|
widgetType={GetConfiguration('hotelview')['widgets']['slot.' + 2 + '.widget']}
|
||||||
|
@ -3,6 +3,7 @@ import { BonusRareWidgetView } from './bonus-rare/BonusRareWidgetView';
|
|||||||
import { GetWidgetLayoutProps } from './GetWidgetLayout.types';
|
import { GetWidgetLayoutProps } from './GetWidgetLayout.types';
|
||||||
import { HallOfFameWidgetView } from './hall-of-fame/HallOfFameWidgetView';
|
import { HallOfFameWidgetView } from './hall-of-fame/HallOfFameWidgetView';
|
||||||
import { PromoArticleWidgetView } from './promo-article/PromoArticleWidgetView';
|
import { PromoArticleWidgetView } from './promo-article/PromoArticleWidgetView';
|
||||||
|
import { WidgetContainerView } from './widgetcontainer/WIdgetContainerView';
|
||||||
|
|
||||||
export const GetWidgetLayout: FC<GetWidgetLayoutProps> = props =>
|
export const GetWidgetLayout: FC<GetWidgetLayoutProps> = props =>
|
||||||
{
|
{
|
||||||
@ -14,6 +15,8 @@ export const GetWidgetLayout: FC<GetWidgetLayoutProps> = props =>
|
|||||||
return <HallOfFameWidgetView slot={props.slot} conf={props.widgetConf} />;
|
return <HallOfFameWidgetView slot={props.slot} conf={props.widgetConf} />;
|
||||||
case "bonusrare":
|
case "bonusrare":
|
||||||
return <BonusRareWidgetView />;
|
return <BonusRareWidgetView />;
|
||||||
|
case "widgetcontainer":
|
||||||
|
return <WidgetContainerView conf={props.widgetConf} />
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -37,15 +37,16 @@ export const PromoArticleWidgetView: FC<PromoArticleWidgetViewProps> = props =>
|
|||||||
</div>
|
</div>
|
||||||
<div className="d-flex flex-row mb-1">
|
<div className="d-flex flex-row mb-1">
|
||||||
{articles && (articles.length > 0) && articles.map((article, ind) =>
|
{articles && (articles.length > 0) && articles.map((article, ind) =>
|
||||||
<div className={`promo-articles-bullet ` + (article === articles[index] ? 'promo-articles-bullet-active' : '')} key={article.id} onClick={event => handleSelect(ind)} />
|
<div className={`promo-articles-bullet cursor-pointer ` + (article === articles[index] ? 'promo-articles-bullet-active' : '')} key={article.id} onClick={event => handleSelect(ind)} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{articles && articles[index] &&
|
{articles && articles[index] &&
|
||||||
<div className="promo-article d-flex flex-row row mx-0">
|
<div className="promo-article d-flex flex-row row mx-0">
|
||||||
<div className="promo-article-image" style={ {backgroundImage: `url(${articles[index].imageUrl})`} }/>
|
<div className="promo-article-image" style={ {backgroundImage: `url(${articles[index].imageUrl})`} }/>
|
||||||
<div className="col-3">
|
<div className="col-3 d-flex flex-column h-100">
|
||||||
<h3 className="my-0">{articles[index].title}</h3>
|
<h3 className="my-0">{articles[index].title}</h3>
|
||||||
<b>{ articles[index].bodyText }</b>
|
<b>{ articles[index].bodyText }</b>
|
||||||
|
<button className="btn btn-sm mt-auto btn-gainsboro">{ articles[index].buttonText }</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,47 @@
|
|||||||
|
import { FC, useCallback, useMemo } from 'react';
|
||||||
|
import { GetConfigurationManager } from '../../../../../api/core/';
|
||||||
|
import { WidgetContainerViewProps } from './WidgetContainerView.types';
|
||||||
|
|
||||||
|
export const WidgetContainerView: FC<WidgetContainerViewProps> = 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 (
|
||||||
|
<div className="widgetcontainer widget">
|
||||||
|
{ getOption('image') }
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
export interface WidgetContainerViewProps
|
||||||
|
{
|
||||||
|
conf: string;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user