From 97b5dea61dad14580de8a16ebc5a116682532bdb Mon Sep 17 00:00:00 2001 From: danidfra Date: Wed, 20 Nov 2024 20:56:43 -0300 Subject: [PATCH 1/6] Adjusting media --- .../ui/components/modals/media-modal.tsx | 22 ++++++++++--------- src/styles/tailwind.css | 11 ++++++++++ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/features/ui/components/modals/media-modal.tsx b/src/features/ui/components/modals/media-modal.tsx index 75dd41218..24e8e4878 100644 --- a/src/features/ui/components/modals/media-modal.tsx +++ b/src/features/ui/components/modals/media-modal.tsx @@ -243,7 +243,7 @@ const MediaModal: React.FC = (props) => { }; return ( -
+
= (props) => {
)} - - {content} - +
+ + {content} + +
{hasMultipleImages && (
diff --git a/src/styles/tailwind.css b/src/styles/tailwind.css index 5981ddc9e..65bc654ed 100644 --- a/src/styles/tailwind.css +++ b/src/styles/tailwind.css @@ -37,6 +37,17 @@ } @layer utilities { + .media-modal * { + img { + max-height: 80vh; + width: 100%; + object-fit: contain; + } + + video { + @apply max-w-full max-h-[80%]; + } + } .status { @apply min-h-[54px] cursor-default animate-fade opacity-100; } From 2251dd9f157f1c6f5e57f07ad3f3a5fa3b2833bd Mon Sep 17 00:00:00 2001 From: danidfra Date: Thu, 21 Nov 2024 17:52:01 -0300 Subject: [PATCH 2/6] Fix media-modal --- src/features/ui/components/image-loader.tsx | 2 +- src/features/ui/components/modals/media-modal.tsx | 2 +- src/styles/tailwind.css | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/features/ui/components/image-loader.tsx b/src/features/ui/components/image-loader.tsx index 7eab09c80..5abd00dde 100644 --- a/src/features/ui/components/image-loader.tsx +++ b/src/features/ui/components/image-loader.tsx @@ -135,7 +135,7 @@ class ImageLoader extends PureComponent { const { alt, src, width, height, onClick } = this.props; const { loading } = this.state; - const className = 'relative size-full flex items-center justify-center flex-col'; + const className = 'relative h-[80vh] flex items-center justify-center flex-col'; return (
diff --git a/src/features/ui/components/modals/media-modal.tsx b/src/features/ui/components/modals/media-modal.tsx index 24e8e4878..34793a776 100644 --- a/src/features/ui/components/modals/media-modal.tsx +++ b/src/features/ui/components/modals/media-modal.tsx @@ -316,7 +316,7 @@ const MediaModal: React.FC = (props) => { style={swipeableViewsStyle} containerStyle={containerStyle} onChangeIndex={handleSwipe} - className='flex items-center justify-center ' + className='flex items-center justify-center' index={getIndex()} > {content} diff --git a/src/styles/tailwind.css b/src/styles/tailwind.css index 65bc654ed..e9e656a9b 100644 --- a/src/styles/tailwind.css +++ b/src/styles/tailwind.css @@ -48,6 +48,7 @@ @apply max-w-full max-h-[80%]; } } + .status { @apply min-h-[54px] cursor-default animate-fade opacity-100; } From 6541baab187eb9165fafe4ff007382fcfd65236c Mon Sep 17 00:00:00 2001 From: danidfra Date: Fri, 22 Nov 2024 12:30:22 -0300 Subject: [PATCH 3/6] Fix media-modal-zoom --- src/features/ui/components/image-loader.tsx | 4 +- .../ui/components/modals/media-modal.tsx | 148 +++++++++--------- src/styles/tailwind.css | 2 - 3 files changed, 77 insertions(+), 77 deletions(-) diff --git a/src/features/ui/components/image-loader.tsx b/src/features/ui/components/image-loader.tsx index 5abd00dde..2635b106c 100644 --- a/src/features/ui/components/image-loader.tsx +++ b/src/features/ui/components/image-loader.tsx @@ -135,13 +135,13 @@ class ImageLoader extends PureComponent { const { alt, src, width, height, onClick } = this.props; const { loading } = this.state; - const className = 'relative h-[80vh] flex items-center justify-center flex-col'; + const className = 'relative h-screen flex items-center justify-center flex-col'; return (
{loading ? ( = (props) => { } justifyContent='between' > - - - - + + - {status && ( + setIsFullScreen(!isFullScreen)} + onClick={handleDownload} /> - )} + + {status && ( + setIsFullScreen(!isFullScreen)} + /> + )} + - - {/* Height based on height of top/bottom bars */} -
- {hasMultipleImages && ( -
- +
+ )} + +
+ - - + {content} +
- )} -
- - {content} - + {hasMultipleImages && ( +
+ +
+ )}
- {hasMultipleImages && ( -
- -
+ {actualStatus && ( + + + )} -
- - {actualStatus && ( - - - - )} + {actualStatus && ( diff --git a/src/styles/tailwind.css b/src/styles/tailwind.css index e9e656a9b..c83ce2a4a 100644 --- a/src/styles/tailwind.css +++ b/src/styles/tailwind.css @@ -39,8 +39,6 @@ @layer utilities { .media-modal * { img { - max-height: 80vh; - width: 100%; object-fit: contain; } From 7b88c4696c2e77d40140d142a8613efc29554d9e Mon Sep 17 00:00:00 2001 From: danidfra Date: Fri, 22 Nov 2024 17:41:36 -0300 Subject: [PATCH 4/6] Upgrade zoom --- src/features/ui/components/zoomable-image.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/features/ui/components/zoomable-image.tsx b/src/features/ui/components/zoomable-image.tsx index 43e4f2740..7260b61bb 100644 --- a/src/features/ui/components/zoomable-image.tsx +++ b/src/features/ui/components/zoomable-image.tsx @@ -1,3 +1,4 @@ +import clsx from 'clsx'; import { PureComponent } from 'react'; const MIN_SCALE = 1; @@ -132,7 +133,7 @@ class ZoomableImage extends PureComponent { role='presentation' ref={this.setImageRef} 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} src={src} style={{ From 440aa8b928be0b2d5a8def5ba72ed3dca771dbbf Mon Sep 17 00:00:00 2001 From: danidfra Date: Fri, 22 Nov 2024 17:42:11 -0300 Subject: [PATCH 5/6] Update bottom of action-buttons --- src/features/ui/components/modals/media-modal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/ui/components/modals/media-modal.tsx b/src/features/ui/components/modals/media-modal.tsx index 69cbd1d19..c9f615f71 100644 --- a/src/features/ui/components/modals/media-modal.tsx +++ b/src/features/ui/components/modals/media-modal.tsx @@ -341,7 +341,7 @@ const MediaModal: React.FC = (props) => { {actualStatus && ( Date: Mon, 25 Nov 2024 12:37:06 -0300 Subject: [PATCH 6/6] Remove unnecessary styles --- src/styles/tailwind.css | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/styles/tailwind.css b/src/styles/tailwind.css index c83ce2a4a..5981ddc9e 100644 --- a/src/styles/tailwind.css +++ b/src/styles/tailwind.css @@ -37,16 +37,6 @@ } @layer utilities { - .media-modal * { - img { - object-fit: contain; - } - - video { - @apply max-w-full max-h-[80%]; - } - } - .status { @apply min-h-[54px] cursor-default animate-fade opacity-100; }