Skip to content
This repository has been archived by the owner on Mar 27, 2018. It is now read-only.

Commit

Permalink
fix(mapper): implement new bundle structure for paragraph mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Wensink committed Sep 14, 2017
1 parent 83a46d3 commit df4f541
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Paragraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const Paragraph = ({ mapper, uuid, page, index }) => {
return null;
}

const Component = typeof mapper === 'function' ? mapper(paragraph.type.target_id) : mapper[paragraph.type.target_id];
const bundle = `${paragraph.__hn.entity.type}__${paragraph.__hn.entity.bundle}`;

const Component = (typeof mapper === 'object' && page.type) ? mapper[bundle] : mapper(page, bundle);

if(!Component) {
return null;
Expand Down

0 comments on commit df4f541

Please sign in to comment.