summaryrefslogtreecommitdiff
path: root/animism-align/frontend/views/align/components
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-07-06 19:28:29 +0200
committerJules Laplace <julescarbon@gmail.com>2020-07-06 19:28:29 +0200
commit07294becb5823b387e6b0ae8caae190a8b08551d (patch)
tree6ba377768f56aac219425973c7a1e57af230e7ec /animism-align/frontend/views/align/components
parent6f5ff3cdfac3fc154281fdda7c1ec9ff7ebbd1fa (diff)
highlight the current paragraph
Diffstat (limited to 'animism-align/frontend/views/align/components')
-rw-r--r--animism-align/frontend/views/align/components/annotations/annotation.types.js22
1 files changed, 19 insertions, 3 deletions
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 (
+ <div
+ className={className}
+ style={{ top: y }}
+ onClick={e => onClick(e, annotation)}
+ onDoubleClick={e => onDoubleClick(e, annotation)}
+ >
+ {text}
+ </div>
+ )
+}
+
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),
+}