коммит заебал

This commit is contained in:
kazachilo 2025-03-25 18:08:00 +03:00
parent b9c026a23c
commit 61a8740d37
4 changed files with 11 additions and 4 deletions

View File

@ -6,6 +6,7 @@ interface ImageWithFallbackProps {
alt: string;
className?: string;
onClick?: () => void;
onContextMenu?: (e: React.MouseEvent<HTMLDivElement>) => void;
maxRetries?: number;
}
@ -14,6 +15,7 @@ const ImageWithFallback: React.FC<ImageWithFallbackProps> = ({
alt,
className = '',
onClick,
onContextMenu,
maxRetries = 2 // По умолчанию 2 попытки автоматической перезагрузки
}) => {
const [loading, setLoading] = useState(true);
@ -109,6 +111,7 @@ const ImageWithFallback: React.FC<ImageWithFallbackProps> = ({
<div
className={`${styles.container} ${className}`}
onClick={handleClick}
onContextMenu={onContextMenu}
>
{/* Показываем индикатор загрузки, если изображение загружается */}
{loading && (

View File

@ -50,14 +50,14 @@ const NotificationModal: React.FC<NotificationModalProps> = ({
<div className={styles.buttons}>
{showGalleryButton && (
<button
className={`${styles.button} ${styles.primaryButton}`}
className={`${styles.button} ${styles.secondaryButton}`}
onClick={onGalleryClick}
>
В галерею
Отмена
</button>
)}
<button
className={`${styles.button} ${!showGalleryButton ? styles.primaryButton : styles.secondaryButton}`}
className={`${styles.button} ${styles.primaryButton}`}
onClick={onContinueClick}
>
{continueButtonText}

View File

@ -166,6 +166,9 @@
width: 100%;
height: 100%;
object-fit: cover;
-webkit-touch-callout: none;
-webkit-user-select: none;
user-select: none;
}
.error {

View File

@ -310,6 +310,7 @@ const GalleryScreen: React.FC = () => {
alt={`Стикер ${index + 1}`}
className={styles.image}
onClick={() => !isDeleteMode && image.url && setSelectedImage(image.url)}
onContextMenu={(e: React.MouseEvent<HTMLDivElement>) => e.preventDefault()}
maxRetries={3}
/>
{isDeleteMode && (
@ -341,7 +342,7 @@ const GalleryScreen: React.FC = () => {
title="Удаление стикера"
message="Вы уверены, что хотите удалить этот стикер?"
isLoading={isDeleting}
showGalleryButton={false}
showGalleryButton={true}
continueButtonText="Удалить"
onContinueClick={handleConfirmDelete}
onGalleryClick={() => setSelectedForDelete(null)}