pass more contextual data to preview components

This commit is contained in:
Shawn Erquhart 2017-06-30 17:59:16 -04:00
parent 324340135b
commit 72a661d132

View File

@ -13,7 +13,7 @@ import styles from './PreviewPane.css';
export default class PreviewPane extends React.Component {
getWidget = (field, value, props) => {
const { fieldsMetaData, getAsset } = props;
const { fieldsMetaData, getAsset, entry } = props;
const widget = resolveWidget(field.get('widget'));
return !widget.preview ? null : React.createElement(widget.preview, {
@ -22,6 +22,8 @@ export default class PreviewPane extends React.Component {
value: value && Map.isMap(value) ? value.get(field.get('name')) : value,
metadata: fieldsMetaData && fieldsMetaData.get(field.get('name')),
getAsset,
entry,
fieldsMetaData,
});
};