n-eventpromo
Eventpromo is used to promote content from live.ft.com.This module is used by n-magnet.
Installation
This module is compatible with Node 12+ and is distributed on npm.npm install --save @financial-times/n-eventpromo @financial-times/x-engine
This module also requires
x-engine
engine as a peer dependency. The Engine module is used to inject your chosen
runtime into the component. Please read the x-engine
documentation first if you are consuming x-
components for the
first time in your application.Eventpromo
Usage
With reactimport React from 'react';
import { Eventpromo } from '@financial-times/x-eventpromo';
// A == B == C
const a = Eventpromo(props);
const b = <Eventpromo {...props} />;
const c = React.createElement(Eventpromo, props);
All x-
components are designed to be compatible with a variety of runtimes, not just React.
Check out the x-engine
engine documentation for a list of recommended libraries and frameworks.Properties
If not marked optional, fields require non-empty values.Property | Type | Default | Notes ---------------------|--------------|-----------|--------------------------------
dates
| String | | Free text, can be either a specific date or a date range
id
| String | | Eventpromo id, 32 chars
imageUrl
| String | | An image url, will be processed via origami image service
link
| String | | Eventpromo url, should include segmentId
location
| String | | No set format: "London", "New York", "ExCeL London", etc
strapline
| String | |
title
| String | |
brand
| String | ft-live
| One of ft-live
, ft-forums
, ft-bdp:workshop
, ft-bdp:diploma
or ft-bdp:masterclass
ctaText
| String | various | Allows changing of the ctaText where desiredDevelopment
git clone git@github.com:Financial-Times/n-eventpromo.git
cd n-eventpromo
make install
make build
Linking to an application
This package does not have a demonstration application, so to test we can link ton-magnet
repostiory which consumes this.Complete the installation for
n-magnet
locally then link n-eventpromo
by running:cd ../n-magnet
npm link ../n-eventpromo
make build && make demo
When making changes after first linking
n-eventpromo
run:# in ./n-eventpromo
make build
# in ./n-magnet
make build && make demo