- {mediaModalItem}
+ {this.props.children}
);
@@ -162,7 +76,7 @@
};
calculateMediaDimensions: () => void = () => {
- if (!this.overlay || !this.props.media.dimensions) {
+ if (!this.overlay || !this.props.contentDimensions) {
return;
}
const containerWidth = this.overlay.clientWidth;
@@ -170,7 +84,7 @@
const containerAspectRatio = containerWidth / containerHeight;
const { width: mediaWidth, height: mediaHeight } =
- this.props.media.dimensions;
+ this.props.contentDimensions;
const mediaAspectRatio = mediaWidth / mediaHeight;
let newWidth, newHeight;
@@ -181,28 +95,22 @@
newHeight = Math.min(mediaHeight, containerWidth / mediaAspectRatio);
newWidth = newHeight * mediaAspectRatio;
}
- this.setState({
- dimensions: {
- width: newWidth,
- height: newHeight,
- },
+ this.props.setContentDimensions({
+ width: newWidth,
+ height: newHeight,
});
};
}
-function ConnectedMultiMediaModal(props: BaseProps): React.Node {
+function ConnectedFullScreenViewModal(props: BaseProps): React.Node {
const modalContext = useModalContext();
- const { thumbHash, encryptionKey, thumbnailEncryptionKey } = props.media;
- const thumbHashEncryptionKey = thumbnailEncryptionKey ?? encryptionKey;
- const placeholderImage = usePlaceholder(thumbHash, thumbHashEncryptionKey);
-
- return (
-