Changeset View
Changeset View
Standalone View
Standalone View
web/media/multimedia.react.js
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | (event: SyntheticEvent<HTMLElement>) => { | ||||
); | ); | ||||
removeProp(pendingUpload.localID); | removeProp(pendingUpload.localID); | ||||
}, | }, | ||||
[removeProp, pendingUpload], | [removeProp, pendingUpload], | ||||
); | ); | ||||
const { pushModal } = useModalContext(); | const { pushModal } = useModalContext(); | ||||
const handleClick = React.useCallback(() => { | const handleClick = React.useCallback(() => { | ||||
let media; | pushModal(<MultimediaModal media={mediaSource} />); | ||||
if ( | |||||
mediaSource.type === 'encrypted_photo' || | |||||
mediaSource.type === 'encrypted_video' | |||||
) { | |||||
const { type, holder, encryptionKey } = mediaSource; | |||||
media = { type, holder, encryptionKey }; | |||||
} else { | |||||
const { type, uri } = mediaSource; | |||||
invariant(uri, 'uri is missing for media modal'); | |||||
media = { type, uri }; | |||||
} | |||||
pushModal(<MultimediaModal media={media} />); | |||||
}, [pushModal, mediaSource]); | }, [pushModal, mediaSource]); | ||||
let progressIndicator, errorIndicator, removeButton; | let progressIndicator, errorIndicator, removeButton; | ||||
const { multimediaImageCSSClass, multimediaCSSClass } = props; | const { multimediaImageCSSClass, multimediaCSSClass } = props; | ||||
if (pendingUpload) { | if (pendingUpload) { | ||||
const { progressPercent, failed } = pendingUpload; | const { progressPercent, failed } = pendingUpload; | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |