Удален файл конфигурации Next.js и несколько SVG-изображений. В компоненте ContactForm и ContactModal улучшена обработка ошибок и добавлена динамическая классовая логика для отображения состояния ошибки. В компоненте Hero также обновлена логика классов. Упрощен компонент Input. Удалены неиспользуемые импорты в компоненте Contacts.

This commit is contained in:
Bivekich
2025-04-03 17:28:15 +03:00
parent 9b75339c1e
commit 8657c49026
19 changed files with 142 additions and 48 deletions

View File

@ -7,6 +7,7 @@ import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { formatPhoneNumber, validatePhoneNumber } from '@/lib/utils';
import { sendTelegramNotification } from '@/lib/telegram';
import { cn } from '@/lib/utils';
interface ContactModalProps {
isOpen: boolean;
@ -51,7 +52,7 @@ const ContactModal = ({ isOpen, onClose }: ContactModalProps) => {
'Произошла ошибка при отправке заявки. Пожалуйста, попробуйте позже.'
);
}
} catch (error) {
} catch {
setError(
'Произошла ошибка при отправке заявки. Пожалуйста, попробуйте позже.'
);
@ -124,7 +125,7 @@ const ContactModal = ({ isOpen, onClose }: ContactModalProps) => {
placeholder="+7 (999) 999-99-99"
value={phone}
onChange={handlePhoneChange}
className="pl-10"
className={cn('pl-10', error && 'border-red-500')}
required
disabled={isLoading || isSubmitted}
/>