fix bank-card validation bug

This commit is contained in:
smanylov
2026-03-24 21:55:43 +07:00
parent f4b4f4bafb
commit 4986455919
4 changed files with 25 additions and 14 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "no-copy-frontend",
"version": "0.68.0",
"version": "0.69.0",
"private": true,
"scripts": {
"dev": "next dev -p 2999",
@@ -10,7 +10,7 @@ import { bankCardFormSchema } from '@/app/actions/definitions';
import { useTranslations } from 'next-intl';
interface cardInfoType {
cardType: string,
cardType: string | null,
potentiallyValid: boolean,
cardValid?: boolean
}
@@ -110,6 +110,7 @@ export default function BankCard() {
}
if (e.target.value.length === 19 && !numberValidation.isValid) {
if (cardInfo) {
setCardInfo((prev) => {
if (prev) {
return {
@@ -118,8 +119,15 @@ export default function BankCard() {
}
}
return null;
});
} else {
setCardInfo({
cardType: null,
potentiallyValid: false,
cardValid: false
})
}
}
if (validatedField.success) {
setFormState(prevState => {
@@ -162,7 +170,7 @@ export default function BankCard() {
disabled={!isEditing}
isValid={cardInfo?.cardValid}
/>
{/* */}
{cardInfo && (
<div
className="card-type"
@@ -173,6 +181,7 @@ export default function BankCard() {
</div>
{cardInfo?.cardValid === false && (
<p className="text-sm text-red-500">
{/* */}
<span>
{t('bank-card-not-valid')}
</span>
@@ -248,7 +257,7 @@ export default function BankCard() {
setIsEditing(true)
}}
>
Изменить
{t('change')}
</button>
)
}
+2 -1
View File
@@ -366,7 +366,8 @@
"search-title-description": "Upload a file to search for similar protected content in your library and on the web",
"how-does-search-work": "How does search work?",
"search-info-description-text": "Our system analyzes the uploaded file and compares it with your protected files, using computer vision and digital fingerprinting algorithms.",
"documents-few": "Documents"
"documents-few": "Documents",
"change": "Change"
},
"Login-register-form": {
"and": "and",
+2 -1
View File
@@ -366,7 +366,8 @@
"search-title-description": "Загрузите файл для поиска похожего защищенного контента в вашей библиотеке и в интернете",
"how-does-search-work": "Как работает поиск?",
"search-info-description-text": "Наша система анализирует загруженный файл и сравнивает его с вашими защищенными файлами, используя алгоритмы компьютерного зрения и цифровых отпечатков.",
"documents-few": "Документов"
"documents-few": "Документов",
"change": "Изменить"
},
"Login-register-form": {
"and": "и",