kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Merge branch 'fix-media-modal' into 'main'
Fix media modal Closes #1791 See merge request soapbox-pub/soapbox!3274merge-requests/3281/head
commit
9b9d6b57f0
|
@ -135,13 +135,13 @@ class ImageLoader extends PureComponent<IImageLoader> {
|
||||||
const { alt, src, width, height, onClick } = this.props;
|
const { alt, src, width, height, onClick } = this.props;
|
||||||
const { loading } = this.state;
|
const { loading } = this.state;
|
||||||
|
|
||||||
const className = 'relative size-full flex items-center justify-center flex-col';
|
const className = 'relative h-screen flex items-center justify-center flex-col';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<canvas
|
<canvas
|
||||||
className={clsx('max-h-[80%] max-w-full object-contain', { 'hidden': !this.hasSize() })}
|
className={clsx('max-h-[100%] max-w-full object-contain', { 'hidden': !this.hasSize() })}
|
||||||
style={{
|
style={{
|
||||||
background: 'url(\'../assets/images/void.png\') repeat',
|
background: 'url(\'../assets/images/void.png\') repeat',
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -243,7 +243,7 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='pointer-events-auto fixed inset-0 z-[9999] h-full bg-gray-900/90'>
|
<div className='media-modal pointer-events-auto fixed inset-0 z-[9999] flex size-full bg-gray-900/90'>
|
||||||
<div
|
<div
|
||||||
className='absolute inset-0'
|
className='absolute inset-0'
|
||||||
role='presentation'
|
role='presentation'
|
||||||
|
@ -258,10 +258,11 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
||||||
}
|
}
|
||||||
justifyContent='between'
|
justifyContent='between'
|
||||||
>
|
>
|
||||||
|
<Stack className='relative h-full'>
|
||||||
<HStack
|
<HStack
|
||||||
alignItems='center'
|
alignItems='center'
|
||||||
justifyContent='between'
|
justifyContent='between'
|
||||||
className={clsx('flex-[0_0_60px] p-4 transition-opacity', navigationHiddenClassName)}
|
className={clsx('absolute z-[9999] flex w-full p-4 transition-opacity', navigationHiddenClassName)}
|
||||||
>
|
>
|
||||||
<IconButton
|
<IconButton
|
||||||
title={intl.formatMessage(messages.close)}
|
title={intl.formatMessage(messages.close)}
|
||||||
|
@ -311,6 +312,7 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
<div className='size-full'>
|
||||||
<ReactSwipeableViews
|
<ReactSwipeableViews
|
||||||
style={swipeableViewsStyle}
|
style={swipeableViewsStyle}
|
||||||
containerStyle={containerStyle}
|
containerStyle={containerStyle}
|
||||||
|
@ -320,6 +322,7 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
||||||
>
|
>
|
||||||
{content}
|
{content}
|
||||||
</ReactSwipeableViews>
|
</ReactSwipeableViews>
|
||||||
|
</div>
|
||||||
|
|
||||||
{hasMultipleImages && (
|
{hasMultipleImages && (
|
||||||
<div className={clsx('absolute inset-y-0 right-5 z-10 flex items-center transition-opacity', navigationHiddenClassName)}>
|
<div className={clsx('absolute inset-y-0 right-5 z-10 flex items-center transition-opacity', navigationHiddenClassName)}>
|
||||||
|
@ -338,7 +341,7 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
||||||
{actualStatus && (
|
{actualStatus && (
|
||||||
<HStack
|
<HStack
|
||||||
justifyContent='center'
|
justifyContent='center'
|
||||||
className={clsx('flex-[0_0_60px] transition-opacity', navigationHiddenClassName)}
|
className={clsx('absolute bottom-2 flex w-full transition-opacity', navigationHiddenClassName)}
|
||||||
>
|
>
|
||||||
<StatusActionBar
|
<StatusActionBar
|
||||||
status={actualStatus}
|
status={actualStatus}
|
||||||
|
@ -348,6 +351,7 @@ const MediaModal: React.FC<IMediaModal> = (props) => {
|
||||||
</HStack>
|
</HStack>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
{actualStatus && (
|
{actualStatus && (
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import clsx from 'clsx';
|
||||||
import { PureComponent } from 'react';
|
import { PureComponent } from 'react';
|
||||||
|
|
||||||
const MIN_SCALE = 1;
|
const MIN_SCALE = 1;
|
||||||
|
@ -132,7 +133,7 @@ class ZoomableImage extends PureComponent<IZoomableImage> {
|
||||||
role='presentation'
|
role='presentation'
|
||||||
ref={this.setImageRef}
|
ref={this.setImageRef}
|
||||||
alt={alt}
|
alt={alt}
|
||||||
className='size-auto max-h-[80%] max-w-full object-contain shadow-2xl'
|
className={clsx('size-auto max-h-[80%] max-w-full object-contain', { 'size-full max-h-full': scale !== 1 })}
|
||||||
title={alt}
|
title={alt}
|
||||||
src={src}
|
src={src}
|
||||||
style={{
|
style={{
|
||||||
|
|
Ładowanie…
Reference in New Issue