From 07294becb5823b387e6b0ae8caae190a8b08551d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 6 Jul 2020 19:28:29 +0200 Subject: highlight the current paragraph --- .../components/annotations/annotation.types.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'animism-align/frontend/views/align/components/annotations') diff --git a/animism-align/frontend/views/align/components/annotations/annotation.types.js b/animism-align/frontend/views/align/components/annotations/annotation.types.js index f95589d..a2eae62 100644 --- a/animism-align/frontend/views/align/components/annotations/annotation.types.js +++ b/animism-align/frontend/views/align/components/annotations/annotation.types.js @@ -41,7 +41,23 @@ export const AnnotationHeader = ({ y, annotation, selected, onClick, onDoubleCli ) } +export const AnnotationParagraphEnd = ({ y, annotation, selected, onClick, onDoubleClick }) => { + const { start_ts, text } = annotation + const className = selected ? 'annotation paragraph_end selected' : 'annotation paragraph_end' + return ( +
onClick(e, annotation)} + onDoubleClick={e => onDoubleClick(e, annotation)} + > + {text} +
+ ) +} + export const AnnotationElementLookup = { - sentence: AnnotationSentence, - header: AnnotationHeader, -} \ No newline at end of file + sentence: React.memo(AnnotationSentence), + header: React.memo(AnnotationHeader), + paragraph_end: React.memo(AnnotationParagraphEnd), +} -- cgit v1.2.3-70-g09d2