diff --git a/example/index.html b/example/index.html index 6737c292..f3e5affb 100644 --- a/example/index.html +++ b/example/index.html @@ -98,10 +98,10 @@ h('h1', {}, title), h('dl', {}, h('dt', {}, 'Posts on Frontpage'), - h('dd', {}, posts && posts.get('front_limit') || '0'), + h('dd', {}, this.props.widgetsFor('posts').getIn(['widgets', 'front_limit']) || 0), h('dt', {}, 'Default Author'), - h('dd', {}, posts && posts.get('author') || 'None'), + h('dd', {}, this.props.widgetsFor('posts').getIn(['data', 'front_limit']) || 'None'), h('dt', {}, 'Default Thumbnail'), h('dd', {}, thumb && h('img', {src: this.props.getAsset(thumb).toString()})) diff --git a/src/components/PreviewPane/PreviewPane.js b/src/components/PreviewPane/PreviewPane.js index 04cf3c93..b7da6e36 100644 --- a/src/components/PreviewPane/PreviewPane.js +++ b/src/components/PreviewPane/PreviewPane.js @@ -1,6 +1,6 @@ import React, { PropTypes } from 'react'; import ReactDOM from 'react-dom'; -import { Map } from 'immutable'; +import { List, Map } from 'immutable'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { ScrollSyncPane } from '../ScrollSync'; import registry from '../../lib/registry'; @@ -55,22 +55,29 @@ export default class PreviewPane extends React.Component { const { fields, entry, getAsset } = this.props; const field = fields && fields.find(f => f.get('name') === name); const nestedFields = field && field.get('fields'); - const values = entry.getIn(['data', field.get('name')]); + const value = entry.getIn(['data', field.get('name')]); const widgetFor = (field, value) => { const widget = resolveWidget(field.get('widget')); return (