summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/components.inline/inline.text.js
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/player/components.inline/inline.text.js
parent0d8f9ca954032c37ba1638728382e80335f734cb (diff)
footnotes in pull quotes
Diffstat (limited to 'animism-align/frontend/app/views/viewer/player/components.inline/inline.text.js')
-rw-r--r--animism-align/frontend/app/views/viewer/player/components.inline/inline.text.js40
1 files changed, 26 insertions, 14 deletions
diff --git a/animism-align/frontend/app/views/viewer/player/components.inline/inline.text.js b/animism-align/frontend/app/views/viewer/player/components.inline/inline.text.js
index d257090..20f45c7 100644
--- a/animism-align/frontend/app/views/viewer/player/components.inline/inline.text.js
+++ b/animism-align/frontend/app/views/viewer/player/components.inline/inline.text.js
@@ -50,20 +50,32 @@ export const Pullquote = ({ paragraph, currentParagraph, currentAnnotation, onAn
className={className}
>
<div className="speaker-icon" onClick={e => onAnnotationClick(e, paragraph, firstAnnotation)}>{SpeakerIcon}</div>
- {paragraph.annotations.map(annotation => (
- <span
- key={annotation.id}
- className={
- annotation.type === 'pullquote_credit'
- ? 'pullquote_credit'
- : annotation.id === currentAnnotation
- ? 'current'
- : ''
- }
- onClick={e => onAnnotationClick(e, paragraph, firstAnnotation)}
- dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }}
- />
- ))}
+ {paragraph.annotations.map(annotation => {
+ if (annotation.type === 'footnote') {
+ return (
+ <span
+ key={annotation.id}
+ className='footnote'
+ onClick={e => onAnnotationClick(e, paragraph, 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, firstAnnotation)}
+ dangerouslySetInnerHTML={{ __html: ' ' + annotation.text + ' ' }}
+ />
+ )
+ })}
</div>
)
}