@financial-times/community-event-teaser
Advanced tools
Comparing version 7.0.2 to 7.1.0-alpha.0
@@ -1,2 +0,3 @@ | ||
export { EventTopicCardItem, EventTopicCardItemProps, } from "./event-topic-card-item"; | ||
import { eventpromoToEventTeaserProps } from "./utils/eventpromoToEventTeaserProps"; | ||
export { EventTopicCardItem, EventTopicCardItemProps } from "./event-topic-card-item"; | ||
export { EventTeaserProps, EventTeaser } from "./event-teaser"; | ||
@@ -6,2 +7,5 @@ export { BrandBanner, BrandBannerProps } from "./brand-banner"; | ||
export { EventTeaserSlice } from "./event-teaser-slice"; | ||
export declare const utils: { | ||
eventpromoToEventTeaserProps: typeof eventpromoToEventTeaserProps; | ||
}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -12,2 +12,20 @@ 'use strict'; | ||
function eventpromoToEventTeaserProps(eventpromo) { | ||
return { | ||
eventUrl: eventpromo.eventUrl, | ||
imgUrl: eventpromo.imageUrl, | ||
lazyLoadImage: false, | ||
location: eventpromo.location, | ||
scheduledEndTime: new Date(eventpromo.scheduledEndTime), | ||
scheduledStartTime: new Date(eventpromo.scheduledStartTime), | ||
showBrand: false, | ||
showImage: false, | ||
showStandfirst: false, | ||
showTimeInTimestamp: false, | ||
standfirst: eventpromo.strapline, | ||
title: eventpromo.title, | ||
id: eventpromo.contentId | ||
}; | ||
} | ||
function formatEventDate(scheduledStartTime) { | ||
@@ -208,13 +226,13 @@ var isSameYear = new Date().getFullYear() === scheduledStartTime.getFullYear(); | ||
function EventTeaser(props) { | ||
var title = props.title, eventUrl = props.eventUrl, location = props.location, scheduledStartTime = props.scheduledStartTime, scheduledEndTime = props.scheduledEndTime, standfirst = props.standfirst, imgUrl = props.imgUrl, _a = props.showStandfirst, showStandfirst = _a === void 0 ? true : _a, _b = props.showImage, showImage = _b === void 0 ? true : _b, _c = props.showTimeInTimestamp, showTimeInTimestamp = _c === void 0 ? false : _c, _d = props.lazyLoadImage, lazyLoadImage = _d === void 0 ? false : _d, _e = props.showBrand, showBrand = _e === void 0 ? true : _e; | ||
return (xEngine.h("div", { className: "event-teaser", "data-trackable": "event-teaser", "data-o-tracking-view": true }, | ||
showImage && imgUrl && (xEngine.h(Image, { url: imgUrl, eventUrl: eventUrl, imageSize: "Small", lazyLoad: lazyLoadImage })), | ||
xEngine.h("div", { className: "event-teaser__content-container" }, | ||
xEngine.h("div", { className: "event-teaser__details" }, | ||
showBrand && xEngine.h(Brand, null), | ||
xEngine.h(Title, { title: title, eventUrl: eventUrl }), | ||
showStandfirst && standfirst && (xEngine.h(Standfirst, { standfirst: standfirst }))), | ||
xEngine.h("div", { className: "event-teaser__footer" }, | ||
xEngine.h(Timestamp, { scheduledStartTime: scheduledStartTime, scheduledEndTime: scheduledEndTime, showTime: showTimeInTimestamp }), | ||
xEngine.h(Location, { location: location }))))); | ||
var id = props.id, title = props.title, eventUrl = props.eventUrl, location = props.location, scheduledStartTime = props.scheduledStartTime, scheduledEndTime = props.scheduledEndTime, standfirst = props.standfirst, imgUrl = props.imgUrl, _a = props.showStandfirst, showStandfirst = _a === void 0 ? true : _a, _b = props.showImage, showImage = _b === void 0 ? true : _b, _c = props.showTimeInTimestamp, showTimeInTimestamp = _c === void 0 ? false : _c, _d = props.lazyLoadImage, lazyLoadImage = _d === void 0 ? false : _d, _e = props.showBrand, showBrand = _e === void 0 ? true : _e; | ||
return (h("div", { className: "event-teaser", "data-trackable": "event-teaser", "data-trackable-context-content-id": id, "data-o-tracking-view": true }, | ||
showImage && imgUrl && (h(Image, { url: imgUrl, eventUrl: eventUrl, imageSize: "Small", lazyLoad: lazyLoadImage })), | ||
h("div", { className: "event-teaser__content-container" }, | ||
h("div", { className: "event-teaser__details" }, | ||
showBrand && h(Brand, null), | ||
h(Title, { title: title, eventUrl: eventUrl }), | ||
showStandfirst && standfirst && (h(Standfirst, { standfirst: standfirst }))), | ||
h("div", { className: "event-teaser__footer" }, | ||
h(Timestamp, { scheduledStartTime: scheduledStartTime, scheduledEndTime: scheduledEndTime, showTime: showTimeInTimestamp }), | ||
h(Location, { location: location }))))); | ||
} | ||
@@ -411,2 +429,6 @@ | ||
var utils = { | ||
eventpromoToEventTeaserProps: eventpromoToEventTeaserProps | ||
}; | ||
exports.BrandBanner = BrandBanner; | ||
@@ -417,2 +439,3 @@ exports.CityBanner = CityBanner; | ||
exports.EventTopicCardItem = EventTopicCardItem; | ||
exports.utils = utils; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@financial-times/community-event-teaser", | ||
"version": "7.0.2", | ||
"version": "7.1.0-alpha.0", | ||
"description": "UI for community events", | ||
@@ -43,3 +43,6 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "72faf1137e482c1e8f6593e17d68ec018f564bd2" | ||
"devDependencies": { | ||
"@financial-times/community-event-client": "^0.0.5-alpha.0" | ||
}, | ||
"gitHead": "8fac9c7a201815436ce99d53a06ed18b1632dc89" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66769
413
1
2