From 964dcf5c85b68207e5bc6c36c0a438855a22e26e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 23 Oct 2020 16:58:15 +0200 Subject: footnotes in pull quotes --- .../transcript/components/elementTypes.text.js | 41 ++++++++++++++-------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'animism-align/frontend/app/views/viewer/transcript/components') diff --git a/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js b/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js index 64bfb63..e81ee7b 100644 --- a/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js +++ b/animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js @@ -8,6 +8,7 @@ export const Paragraph = ({ paragraph, currentParagraph, currentAnnotation, onAn if (className !== 'paragraph') className += ' paragraph' if (currentParagraph) className += ' current' const firstAnnotation = paragraph.annotations[0] +console.log(paragraph.start_ts, paragraph) return (
- {paragraph.annotations.map(annotation => ( - onAnnotationClick(e, paragraph, annotation)} - dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }} - /> - ))} + {paragraph.annotations.map(annotation => { + if (annotation.type === 'footnote') { + return ( + onAnnotationClick(e, annotation, annotation)} + dangerouslySetInnerHTML={{ __html: annotation.footnote_id }} + /> + ) + } + return ( + onAnnotationClick(e, paragraph, annotation)} + dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }} + /> + ) + })}
) } -- cgit v1.2.3-70-g09d2