From 03db10064e75009b96c9371bcbb26e87ae803d96 Mon Sep 17 00:00:00 2001 From: dan-searle Date: Fri, 30 Nov 2018 10:51:05 +0000 Subject: [PATCH] Allow csrfToken to be set via a prop. --- components/x-teaser-list/readme.md | 3 ++- components/x-teaser-list/src/TeaserList.jsx | 4 ++-- components/x-teaser-list/stories/with-save-buttons.js | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/x-teaser-list/readme.md b/components/x-teaser-list/readme.md index dd9aeeda3..116133767 100644 --- a/components/x-teaser-list/readme.md +++ b/components/x-teaser-list/readme.md @@ -33,9 +33,10 @@ All `x-` components are designed to be compatible with a variety of runtimes, no [jsx-wtf]: https://jasonformat.com/wtf-is-jsx/ -### Properties +### Props Feature | Type | Notes ------------------|---------|---------------------------- `items` | Array | Array of objects representing content items in Teaser format. `showSaveButtons` | Boolean | Default = true. Whether to show the save buttons. +`csrfToken` | String | Cross-site Request Forgery token. Required if save buttons are shown. diff --git a/components/x-teaser-list/src/TeaserList.jsx b/components/x-teaser-list/src/TeaserList.jsx index 836c47129..84154b599 100644 --- a/components/x-teaser-list/src/TeaserList.jsx +++ b/components/x-teaser-list/src/TeaserList.jsx @@ -4,7 +4,7 @@ import { Teaser, presets } from '@financial-times/x-teaser'; import classNames from 'classnames'; import styles from './TeaserList.scss'; -const TeaserList = ({ items = [], showSaveButtons = true }) => ( +const TeaserList = ({ items = [], showSaveButtons = true, csrfToken = null }) => (