summaryrefslogtreecommitdiff
path: root/animism-align/frontend/views/align/components/annotations/annotationForms/annotationForm.image.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-07-17 18:52:24 +0200
committerJules Laplace <julescarbon@gmail.com>2020-07-17 18:52:24 +0200
commit4bb72b9f6d2a56fc6bd67f4248fcabfcc8166493 (patch)
tree55874ddef076c2b608844388fc40deedf8da55d0 /animism-align/frontend/views/align/components/annotations/annotationForms/annotationForm.image.js
parentd579a10ba169d6e95e8ea8a9d7f2821fe89bca1f (diff)
refactor annotation and paragraph types
Diffstat (limited to 'animism-align/frontend/views/align/components/annotations/annotationForms/annotationForm.image.js')
-rw-r--r--animism-align/frontend/views/align/components/annotations/annotationForms/annotationForm.image.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/animism-align/frontend/views/align/components/annotations/annotationForms/annotationForm.image.js b/animism-align/frontend/views/align/components/annotations/annotationForms/annotationForm.image.js
new file mode 100644
index 0000000..e2df98b
--- /dev/null
+++ b/animism-align/frontend/views/align/components/annotations/annotationForms/annotationForm.image.js
@@ -0,0 +1,27 @@
+import React, { Component } from 'react'
+
+import { Select } from '../../../../../common'
+
+export const AnnotationFormImage = ({ annotation, media, handleSettingsSelect }) => {
+ if (!media.lookup) return <div />
+ const { lookup, order } = media
+ const image_list_items = order.filter(id => lookup[id].type === 'image').map(id => {
+ const image = lookup[id]
+ return {
+ name: image.id,
+ label: image.author + ' - ' + image.title
+ }
+ })
+ return (
+ <div>
+ <Select
+ name='media_id'
+ className="media_id"
+ selected={annotation.settings.media_id}
+ options={image_list_items}
+ defaultOption='Choose an image'
+ onChange={handleSettingsSelect}
+ />
+ </div>
+ )
+}