diff --git a/src/components/blocks/GenerateButton.module.css b/src/components/blocks/GenerateButton.module.css index b1fc4f8..be8dc9a 100644 --- a/src/components/blocks/GenerateButton.module.css +++ b/src/components/blocks/GenerateButton.module.css @@ -2,7 +2,7 @@ width: 100%; max-width: 28rem; margin: 24px auto; - padding: 16px; + padding: 12px; border: none; border-radius: 12px; background: linear-gradient(135deg, #4CAF50, #45A049); diff --git a/src/components/shared/ImageViewer.tsx b/src/components/shared/ImageViewer.tsx index 45afa96..c5565cd 100644 --- a/src/components/shared/ImageViewer.tsx +++ b/src/components/shared/ImageViewer.tsx @@ -17,7 +17,7 @@ const ImageViewer: React.FC = ({ imageUrl, onClose }) => { // Закрытие при клике на фон const handleBackdropClick = (e: React.MouseEvent) => { if (e.target === e.currentTarget) { - onClose(); + handleClose(); } }; @@ -46,7 +46,7 @@ const ImageViewer: React.FC = ({ imageUrl, onClose }) => { const isUpSwipe = distance > minSwipeDistance; if (isUpSwipe) { - onClose(); + handleClose(); } else { // Если свайп не завершен, плавно возвращаем изображение на место setTranslateY(0); @@ -57,11 +57,16 @@ const ImageViewer: React.FC = ({ imageUrl, onClose }) => { setTouchEnd(null); }; + // Функция для закрытия просмотрщика + const handleClose = () => { + onClose(); + }; + // Закрытие при нажатии Escape useEffect(() => { const handleEscKey = (e: KeyboardEvent) => { if (e.key === 'Escape') { - onClose(); + handleClose(); } }; @@ -86,7 +91,7 @@ const ImageViewer: React.FC = ({ imageUrl, onClose }) => { onTouchEnd={handleTouchEnd} >
-