@financial-times/n-eventpromo

Promote content from live.ft.com

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@financial-times/n-eventpromo
10.0.0a month ago4 years agoMinified + gzip package size for @financial-times/n-eventpromo in KB

Readme

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-engineengine 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 react
import 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-engineengine 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 desired

Development

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 to n-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