summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/align/components/annotations/annotationForms
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend/app/views/align/components/annotations/annotationForms')
-rw-r--r--animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.utility.js48
-rw-r--r--animism-align/frontend/app/views/align/components/annotations/annotationForms/index.js2
2 files changed, 50 insertions, 0 deletions
diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.utility.js b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.utility.js
index 6c835c5..750c3a7 100644
--- a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.utility.js
+++ b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.utility.js
@@ -5,6 +5,54 @@ import { TextInput, LabelDescription, Select, Checkbox } from 'app/common'
import { CURTAIN_COLOR_SELECT_OPTIONS } from 'app/constants'
import { annotationFadeTimings } from 'app/utils/annotation.utils'
+export const AnnotationFormIntro = ({ annotation, media, handleSettingsChange, handleSettingsSelect }) => {
+ if (!media.lookup) return <div />
+ const { lookup, order } = media
+ const image_list_items = order.filter(id => lookup[id].type === 'file').map(id => {
+ const image = lookup[id]
+ return {
+ name: image.id,
+ label: image.title
+ }
+ })
+ return (
+ <div className='options'>
+ <Select
+ name='media_id'
+ className="media_id"
+ selected={annotation.settings.media_id}
+ options={image_list_items}
+ defaultOption='Choose a file'
+ onChange={handleSettingsSelect}
+ />
+
+ <TextInput
+ title="Title"
+ name="title"
+ placeholder="Enter title or leave blank"
+ data={annotation.settings}
+ onChange={handleSettingsChange}
+ autoComplete="off"
+ />
+
+ <TextInput
+ title="Subtitle"
+ name="subtitle"
+ placeholder="Enter subtitle or leave blank"
+ data={annotation.settings}
+ onChange={handleSettingsChange}
+ autoComplete="off"
+ />
+
+ <AnnotationFormFullscreen
+ annotation={annotation}
+ handleSettingsChange={handleSettingsChange}
+ handleSettingsSelect={handleSettingsSelect}
+ />
+ </div>
+ )
+}
+
export const AnnotationFormCurtain = ({ annotation, handleSettingsChange, handleSettingsSelect }) => {
return (
<div className='options'>
diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationForms/index.js b/animism-align/frontend/app/views/align/components/annotations/annotationForms/index.js
index 0b36d9a..dd601bc 100644
--- a/animism-align/frontend/app/views/align/components/annotations/annotationForms/index.js
+++ b/animism-align/frontend/app/views/align/components/annotations/annotationForms/index.js
@@ -12,11 +12,13 @@ import {
import {
AnnotationFormCurtain,
+ AnnotationFormIntro,
} from './annotationForm.utility'
export const annotationFormLookup = {
section_heading: AnnotationFormSectionHeading,
image: AnnotationFormImage,
video: AnnotationFormVideo,
+ intro: AnnotationFormIntro,
curtain: AnnotationFormCurtain,
}