Перепиливание под чистый DDD

This commit is contained in:
Халимов Рустам
2026-03-22 23:59:33 +03:00
parent 5da1a2f45d
commit 6e532b021d
302 changed files with 3595 additions and 3679 deletions

View File

@@ -285,6 +285,7 @@ const translations = {
loadChatsError: 'Ошибка загрузки чатов',
loadMessagesError: 'Ошибка загрузки сообщений',
unreadMessages: 'Непрочитанные сообщения',
attachmentDiscardConfirm: 'У вас есть прикрепленные вложения. Если вы перейдете в другой чат, они будут потеряны. Продолжить?',
},
en: {
myProfile: 'My Profile',
@@ -540,6 +541,7 @@ const translations = {
loadChatsError: 'Error loading chats',
loadMessagesError: 'Error loading messages',
unreadMessages: 'Unread messages',
attachmentDiscardConfirm: 'You have attached files. If you switch to another chat, they will be lost. Continue?',
},
} as const;

View File

@@ -13,8 +13,14 @@ interface ImageLightboxProps {
export default function ImageLightbox({ url, images, initialIndex = 0, onClose }: ImageLightboxProps) {
const gallery = images && images.length > 0;
const [index, setIndex] = useState(initialIndex);
const currentUrl = gallery ? images![index].url : url!;
useEffect(() => {
setIndex(initialIndex);
}, [initialIndex]);
const rawUrl = gallery ? images![index].url : url!;
const currentType = gallery ? images![index].type : undefined;
const currentUrl = currentType === 'video' ? rawUrl + (rawUrl.includes('?') ? '&lb=' + index : '?lb=' + index) : rawUrl;
const total = gallery ? images!.length : 1;
const goPrev = useCallback(() => {
@@ -101,6 +107,7 @@ export default function ImageLightbox({ url, images, initialIndex = 0, onClose }
src={currentUrl}
controls
autoPlay
playsInline
preload="metadata"
className="w-full h-full object-contain outline-none bg-black/50"
/>