Description
- This is a package which contains the UI component for an event.
- The Community-event-teaser provides two elements for rendering
EventTeaser
and EventTopicCardItem
Installation
npm install @financial-times/community-event-teaser
Usage
- Example of how to use the
<EventTeaser/>
import { h, render } from '@financial-times/x-engine';
import { EventTeaser } from "@financial-times/community-event-teaser";
const container = document.querySelector('.some-container-element');
render((
<EventTeaser
imgUrl={"https://ftweekend.live.ft.com/some-cool-image-png"}
title={"FTWeekend Festival"}
standfirst={"Some short description of the event"}
eventUrl={"https://ftweekend.live.ft.com"}
lazyLoadImage={"some__lazy-loading-classname"}
location={"Kenwood House Gardens & Online"}
scheduledStartTime={new Date("2021-09-04T12:00:00.000Z")}
showImage={true}
showBrand={true}
showStandfirst={true}
/>), container)
- Example of how using the
EventTopicCardItem
import { h, render } from '@financial-times/x-engine';
import { EventTopicCardItem } from "@financial-times/community-event-teaser";
const container = document.querySelector('.some-container-element');
render((
<EventTopicCardItem
title={"FTWeekend Festival"}
eventUrl={"https://ftweekend.live.ft.com"}
location={"Kenwood House Gardens & Online"}
scheduledStartTime={new Date("2021-09-04T12:00:00.000Z")}
/>), container)
Development
Setting up your local environment
- Simply clone this repo, cd into the directory and run:
npm install
Storybooks
npm run storybook