summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/transcript/components
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-10-23 16:58:15 +0200
committerJules Laplace <julescarbon@gmail.com>2020-10-23 16:58:15 +0200
commit964dcf5c85b68207e5bc6c36c0a438855a22e26e (patch)
treedb1483caee55d66f8d3bc766c23ed8eaacb814ac /animism-align/frontend/app/views/viewer/transcript/components
parent0d8f9ca954032c37ba1638728382e80335f734cb (diff)
footnotes in pull quotes
Diffstat (limited to 'animism-align/frontend/app/views/viewer/transcript/components')
-rw-r--r--animism-align/frontend/app/views/viewer/transcript/components/elementTypes.text.js41
1 files changed, 27 insertions, 14 deletions
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 (
<div
className={className}
@@ -49,20 +50,32 @@ export const Pullquote = ({ paragraph, currentParagraph, currentAnnotation, onAn
data-startts={paragraph.start_ts}
data-endts={paragraph.end_ts}
>
- {paragraph.annotations.map(annotation => (
- <span
- key={annotation.id}
- className={
- annotation.type === 'pullquote_credit'
- ? 'pullquote_credit'
- : annotation.id === currentAnnotation
- ? 'current'
- : ''
- }
- onClick={e => onAnnotationClick(e, paragraph, annotation)}
- dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }}
- />
- ))}
+ {paragraph.annotations.map(annotation => {
+ if (annotation.type === 'footnote') {
+ return (
+ <span
+ key={annotation.id}
+ className='footnote'
+ onClick={e => onAnnotationClick(e, annotation, annotation)}
+ dangerouslySetInnerHTML={{ __html: annotation.footnote_id }}
+ />
+ )
+ }
+ return (
+ <span
+ key={annotation.id}
+ className={
+ annotation.type === 'pullquote_credit'
+ ? 'pullquote_credit'
+ : annotation.id === currentAnnotation
+ ? 'current'
+ : ''
+ }
+ onClick={e => onAnnotationClick(e, paragraph, annotation)}
+ dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }}
+ />
+ )
+ })}
</div>
)
}