From 4bb72b9f6d2a56fc6bd67f4248fcabfcc8166493 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 17 Jul 2020 18:52:24 +0200 Subject: refactor annotation and paragraph types --- .../annotationForms/annotationForm.image.js | 27 ++++++++++++++++++++++ .../annotationForms/annotationForm.video.js | 27 ++++++++++++++++++++++ .../annotations/annotationForms/index.js | 12 ++++++++++ 3 files changed, 66 insertions(+) create mode 100644 animism-align/frontend/views/align/components/annotations/annotationForms/annotationForm.image.js create mode 100644 animism-align/frontend/views/align/components/annotations/annotationForms/annotationForm.video.js create mode 100644 animism-align/frontend/views/align/components/annotations/annotationForms/index.js (limited to 'animism-align/frontend/views/align/components/annotations/annotationForms') 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
+ 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 ( +
+ +
+ ) +} diff --git a/animism-align/frontend/views/align/components/annotations/annotationForms/index.js b/animism-align/frontend/views/align/components/annotations/annotationForms/index.js new file mode 100644 index 0000000..1411efc --- /dev/null +++ b/animism-align/frontend/views/align/components/annotations/annotationForms/index.js @@ -0,0 +1,12 @@ +import { + AnnotationFormVideo, +} from './annotationForm.video' + +import { + AnnotationFormImage, +} from './annotationForm.image' + +export { + AnnotationFormImage, + AnnotationFormVideo, +} -- cgit v1.2.3-70-g09d2