From a11abdbb565b245a45700161f5cca36b34b15e31 Mon Sep 17 00:00:00 2001 From: smanylov Date: Wed, 4 Mar 2026 16:15:21 +0700 Subject: [PATCH] change modal-window for file-info style --- src/app/styles/pages-styles.scss | 29 +-- .../modal-windows/file-info-modal-window.tsx | 195 ++++++++---------- src/i18n/messages/en.json | 8 +- src/i18n/messages/ru.json | 8 +- 4 files changed, 120 insertions(+), 120 deletions(-) diff --git a/src/app/styles/pages-styles.scss b/src/app/styles/pages-styles.scss index 7595e47..5b0d202 100644 --- a/src/app/styles/pages-styles.scss +++ b/src/app/styles/pages-styles.scss @@ -3486,18 +3486,6 @@ } .modal-window-view-file { - /* position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 90%; - max-width: 1200px; - max-height: 90%; - background: white; - border-radius: 16px; - padding: 0; - overflow: hidden; - box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5); */ border-radius: 20px; overflow: hidden; @@ -3533,7 +3521,7 @@ &.image { display: grid; - grid-template-columns: 1fr 300px; + grid-template-columns: 1fr 1fr; gap: 20px; } } @@ -3565,12 +3553,27 @@ } } + .file-info-wrapper { + display: flex; + gap: 15px; + margin-bottom: 15px; + + @media (max-width: 875px) { + flex-direction: column; + } + } + .file-info-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 0; overflow: hidden; + min-width: 400px; + + @media (max-width: 470px) { + min-width: auto; + } .info-header { background: #f8fafc; diff --git a/src/app/ui/modal-windows/file-info-modal-window.tsx b/src/app/ui/modal-windows/file-info-modal-window.tsx index edf0764..7437b47 100644 --- a/src/app/ui/modal-windows/file-info-modal-window.tsx +++ b/src/app/ui/modal-windows/file-info-modal-window.tsx @@ -1,141 +1,126 @@ import { convertBytes } from '@/app/lib/convertBytes'; import { formatDate, formatDateTime } from '@/app/lib/formatDate'; +import { useTranslations } from 'next-intl'; export function FileInfoModalWindow({ fileInfo, setWindowClose, setWindowChildren }: any) { + const t = useTranslations('Global'); - const exampleTest = { - ownerName: 'string', - ownerMail: 'string', - ownerCompany: 'string', - fileName: 'string', - fileSize: 'number', - fileUploadDate: 'number', - fileFormat: 'string', - protectStatus: 'string', - checksCount: 'number' - } - - function closeHandler() { - setWindowChildren(null); - setWindowClose(false); - } + console.log(fileInfo); return ( -
- -
-

- Результат проверки -

- + {fileInfo.fileName ? fileInfo.fileName : '-'} +
- -

- Информация о владельце -

-
-
-
- Имя +
+
+

{t('owner-information')}

-
- {fileInfo.ownerName ? fileInfo.ownerName : '-'} +
+
+ {t('name')}: +
+
+ {fileInfo.ownerName ? fileInfo.ownerName : '-'} +
+
+ +
+
+ {t('email')}: +
+
+ {fileInfo.ownerEmail ? fileInfo.ownerEmail : '-'} +
+
+ +
+
+ {t('company')}: +
+
+ {fileInfo.ownerCompany ? fileInfo.ownerCompany : '-'} +
-
-
- Email + +
+
+

{t('file-information')}

-
- {fileInfo.ownerEmail ? fileInfo.ownerEmail : '-'} + +
+
+ {t('file-name')} +
+
+ {fileInfo.fileName ? fileInfo.fileName : '-'} +
-
-
-
- Компания +
+
+ {t('size')} +
+
+ {fileInfo.fileSize ? convertBytes(fileInfo.fileSize) : '-'} +
-
- {fileInfo.ownerCompany ? fileInfo.ownerCompany : '-'} +
+
+ {t('loaded')} +
+
+ {fileInfo.fileUploadDate ? `${formatDate(fileInfo.fileUploadDate)} ${formatDateTime(fileInfo.fileUploadDate)}` : '-'} +
+
+
+
+ {t('format')} +
+
+ {fileInfo.fileExtension ? fileInfo.fileExtension : '-'} +
-

- Информация о файле -

-
-
-
- Имя файла -
-
- {fileInfo.fileName ? fileInfo.fileName : '-'} -
+
+

{t('security-details')}

-
-
- Размер +
+
+ {t('protection-status')}
-
- {fileInfo.fileSize ? convertBytes(fileInfo.fileSize) : '-'} -
-
-
-
- Загружен -
-
- {fileInfo.fileUploadDate ? `${formatDate(fileInfo.fileUploadDate)} ${formatDateTime(fileInfo.fileUploadDate)}` : '-'} -
-
-
-
- Формат -
-
- {fileInfo.fileExtension ? fileInfo.fileExtension : '-'} -
-
-
- -

- Детали защиты -

-
-
-
- Статус защиты -
-
+
{fileInfo.protectStatus ? fileInfo.protectStatus : '-'}
-
-
- Количество проверок +
+
+ {t('number-of-checks')}
-
+
{fileInfo.checksCount ? fileInfo.checksCount : '0'}
-
) diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index ee6d121..8ab6472 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -287,7 +287,13 @@ "file-information": "File information", "id-in-the-system": "ID in the system", "protection-status": "Protection status", - "file-for-search-unsupported": "File for search unsupported" + "file-for-search-unsupported": "File for search unsupported", + "name": "Name", + "owner-information": "Owner information", + "security-details": "Security details", + "number-of-checks": "Number of checks", + "format": "Format", + "file-name": "File name" }, "Login-register-form": { "and": "and", diff --git a/src/i18n/messages/ru.json b/src/i18n/messages/ru.json index e414c68..98a377f 100644 --- a/src/i18n/messages/ru.json +++ b/src/i18n/messages/ru.json @@ -287,7 +287,13 @@ "file-information": "Информация о файле", "id-in-the-system": "ID в системе", "protection-status": "Статус защиты", - "file-for-search-unsupported": "Файл для поиска не поддерживается" + "file-for-search-unsupported": "Файл для поиска не поддерживается", + "name": "Имя", + "owner-information": "Информация о владельце", + "security-details": "Детали защиты", + "number-of-checks": "Количество проверок", + "format": "Формат", + "file-name": "Имя файла" }, "Login-register-form": { "and": "и",