From d6dee3361e4073bdd9c9e4c5cc6a0e3f2355998b Mon Sep 17 00:00:00 2001 From: smanylov Date: Thu, 2 Apr 2026 16:46:50 +0700 Subject: [PATCH] continue: user verification --- src/app/styles/settings.scss | 54 ++++++- .../component/verification-upload-section.tsx | 146 +++++++++--------- .../ui/settings/setting-user-verification.tsx | 14 +- 3 files changed, 130 insertions(+), 84 deletions(-) diff --git a/src/app/styles/settings.scss b/src/app/styles/settings.scss index df7a39b..23b6f10 100644 --- a/src/app/styles/settings.scss +++ b/src/app/styles/settings.scss @@ -220,8 +220,58 @@ } } - .verefication-section { - + &.verefication-section { + height: 100%; + display: flex; + flex-direction: column; + + .verefication-block { + flex-grow: 1; + display: flex; + flex-direction: column; + + .drag-drop-zone { + border: 2px dashed #6366f1; + border-radius: .75rem; + padding: 10px; + } + + .selected-file-action-panel { + display: flex; + justify-content: center; + gap: 10px; + } + + .selected-file-actions { + display: flex; + justify-content: center; + gap: 10px; + } + + .description { + font-size: 12px; + color: v.$text-s; + } + + .btn { + padding: 5px 12px; + } + + .btn-confirm { + background: v.$p-color; + color: v.$white; + + background: linear-gradient(135deg, v.$p-color, v.$s-color); + color: v.$white; + border: 2px solid transparent; + padding: 2px 10px; + } + + .btn-cancel { + border: 2px solid v.$p-color; + padding: 2px 10px; + } + } } } diff --git a/src/app/ui/settings/component/verification-upload-section.tsx b/src/app/ui/settings/component/verification-upload-section.tsx index 53961b4..fe5b8d0 100644 --- a/src/app/ui/settings/component/verification-upload-section.tsx +++ b/src/app/ui/settings/component/verification-upload-section.tsx @@ -115,6 +115,11 @@ export default function VerificationUploadSection({ const currentFileNames = new Set(); const duplicateNames: string[] = []; + if (selectedFiles.length + files.length > 4) { + setError('max-lenght'); + return + } + for (const file of files) { if (selectedFileNames.has(file.name)) { duplicateNames.push(file.name); @@ -398,7 +403,7 @@ export default function VerificationUploadSection({ }); return ( -
+

Загрузка изображений удостоверения личности

@@ -409,9 +414,9 @@ export default function VerificationUploadSection({ onDragLeave={handleDragLeave} onDrop={handleDrop} > -

+ {/*

{t('drag-the-file-here')} -

+ */} { fileType === "image" && ( @@ -423,9 +428,9 @@ export default function VerificationUploadSection({

{t('file-format')}: {acceptString}

- < p className="description" > + {/* < p className="description" > {t('file-size')}: {t('to')} {(maxFileSize / 1024 / 1024)} {t('mb')} -

+

*/} < input ref={fileInputRef} @@ -437,15 +442,6 @@ export default function VerificationUploadSection({ multiple // Добавляем multiple для выбора нескольких файлов /> - - { error && (
@@ -456,9 +452,9 @@ export default function VerificationUploadSection({ { selectedFiles.length > 0 && ( -
+
-
+ {/*

{t('total-files')}: {selectedFiles.length} {t('uploading')}: {uploadingCount} @@ -472,25 +468,23 @@ export default function VerificationUploadSection({ >

-
+
*/} -
- - < button - className="btn btn-primary" - onClick={() => handleClearFile()} - type="button" - > - {t('clear-all')} - -
+ + < button + className="btn btn-primary" + onClick={() => handleClearFile()} + type="button" + > + {t('clear-all')} +
@@ -505,10 +499,12 @@ export default function VerificationUploadSection({

{t('file')}: {file.name}

- < p className="text-gray-700" > + + {/* < p className="text-gray-700" > {t('size')}: {file.size} -

- < p className="text-gray-700" > +

*/} + + {/* < p className="text-gray-700" > {t('status')}: -

+

*/} + { file.error && (

{file.error}

) }
-
-
- +
+
+
+
+ + {/* {file.progress} % - +
*/} +
+ { + file.status === 'pending' && ( + + ) + } + < button className="btn btn-cancel" onClick={() => handleClearFile(file.uploadId || file.name)} @@ -549,44 +571,20 @@ export default function VerificationUploadSection({
- -{/* { - (fileType === 'image' && file.preview) && ( -
- Предпросмотр загруженного документа setError('Не удалось загрузить превью документа') - } - /> -
- - ) - } */} - - { - file.status === 'pending' && ( -
- -
- )}
))}
)} + ); } \ No newline at end of file diff --git a/src/app/ui/settings/setting-user-verification.tsx b/src/app/ui/settings/setting-user-verification.tsx index 08f9614..b112fdf 100644 --- a/src/app/ui/settings/setting-user-verification.tsx +++ b/src/app/ui/settings/setting-user-verification.tsx @@ -15,16 +15,14 @@ export default function SettingUserVerification() {

Верификация юзера

-
-{/* */} - {/* */} - )