From a43615e0c0d4edc34a0f4a14172e559f00be298a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 27 Jul 2020 19:21:55 +0200 Subject: break out fullscreen form. refactor heading --- .../annotationForms/annotationForm.image.js | 10 ++- .../annotationForms/annotationForm.utility.js | 78 +++++++++++++++------- .../annotationForms/annotationForm.video.js | 2 +- 3 files changed, 63 insertions(+), 27 deletions(-) (limited to 'animism-align/frontend/app/views/align/components/annotations/annotationForms') diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js index 8457b68..490c822 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js +++ b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js @@ -1,8 +1,9 @@ import React, { Component } from 'react' import { Select } from 'app/common' +import { AnnotationFormFullscreen } from './annotationForm.utility' -export const AnnotationFormImage = ({ annotation, media, handleSettingsSelect }) => { +export const AnnotationFormImage = ({ annotation, media, handleSettingsSelect, handleSettingsChange }) => { if (!media.lookup) return
const { lookup, order } = media const image_list_items = order.filter(id => lookup[id].type === 'image').map(id => { @@ -13,7 +14,7 @@ export const AnnotationFormImage = ({ annotation, media, handleSettingsSelect }) } }) return ( -
+
+ + + + +
+ ) +} + +export const AnnotationFormFullscreen = ({ annotation, alwaysAccessible, handleSettingsChange, handleSettingsSelect }) => { + if (!alwaysAccessible && !annotation.settings.fullscreen) { + return ( + + ) + } const { fadeInDuration, fadeOutDuration, duration, start_ts, end_ts, fade_in_end_ts, fade_out_start_ts, - } = curtainTimings(annotation) - + } = annotationFadeTimings(annotation) return ( -
+
+ {!alwaysAccessible && ( + + )} - -