Changeset View
Changeset View
Standalone View
Standalone View
web/media/multimedia-modal.react.js
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | if (media.type === 'photo') { | ||||
thumbHashDataURL={placeholderImage} | thumbHashDataURL={placeholderImage} | ||||
/> | /> | ||||
); | ); | ||||
} else { | } else { | ||||
invariant( | invariant( | ||||
media.type === 'encrypted_photo' || media.type === 'encrypted_video', | media.type === 'encrypted_photo' || media.type === 'encrypted_video', | ||||
'invalid media type', | 'invalid media type', | ||||
); | ); | ||||
const { type, holder, encryptionKey } = media; | const { | ||||
type, | |||||
holder, | |||||
encryptionKey, | |||||
thumbnailHolder, | |||||
thumbnailEncryptionKey, | |||||
} = media; | |||||
const dimensions = this.state.dimensions ?? media.dimensions; | |||||
const elementStyle = dimensions | |||||
? { | |||||
width: `${dimensions.width}px`, | |||||
height: `${dimensions.height}px`, | |||||
} | |||||
: undefined; | |||||
mediaModalItem = ( | mediaModalItem = ( | ||||
<EncryptedMultimedia | <EncryptedMultimedia | ||||
type={type} | type={type} | ||||
holder={holder} | holder={holder} | ||||
encryptionKey={encryptionKey} | encryptionKey={encryptionKey} | ||||
thumbnailHolder={thumbnailHolder} | |||||
thumbnailEncryptionKey={thumbnailEncryptionKey} | |||||
placeholderSrc={placeholderImage} | |||||
elementStyle={elementStyle} | |||||
/> | /> | ||||
); | ); | ||||
} | } | ||||
return ( | return ( | ||||
<div | <div | ||||
className={css.multimediaModalOverlay} | className={css.multimediaModalOverlay} | ||||
ref={this.overlayRef} | ref={this.overlayRef} | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |