Обновлен Dockerfile для установки wget и добавлены зависимости в компонентах. Исправлены зависимости в хуках и компонентах, улучшено логирование и обработка ошибок. Удалены неиспользуемые импорты и оптимизированы некоторые функции. Обновлены компоненты для работы с изображениями и улучшена структура кода.

This commit is contained in:
Bivekich
2025-07-17 11:18:32 +03:00
parent 99e91287f3
commit 83ed577a44
24 changed files with 80 additions and 119 deletions

View File

@ -8,7 +8,7 @@ import { InnStep } from "./inn-step"
import { MarketplaceApiStep } from "./marketplace-api-step"
import { ConfirmationStep } from "./confirmation-step"
import { CheckCircle } from "lucide-react"
import { useAuth } from '@/hooks/useAuth'
type AuthStep = 'phone' | 'sms' | 'cabinet-select' | 'inn' | 'marketplace-api' | 'confirmation' | 'complete'
type CabinetType = 'fulfillment' | 'seller' | 'logist' | 'wholesale'
@ -61,8 +61,6 @@ export function AuthFlow({ partnerCode }: AuthFlowProps = {}) {
partnerCode: partnerCode
})
const { verifySmsCode, checkAuth } = useAuth()
// При завершении авторизации инициируем проверку и перенаправление
useEffect(() => {
if (step === 'complete') {
@ -126,10 +124,6 @@ export function AuthFlow({ partnerCode }: AuthFlowProps = {}) {
setStep('complete')
}
const handlePhoneBack = () => {
setStep('phone')
}
const handleSmsBack = () => {
setStep('phone')
}
@ -240,7 +234,7 @@ export function AuthFlow({ partnerCode }: AuthFlowProps = {}) {
onBack={handleConfirmationBack}
/>
)}
{step === 'complete' && (
{(step as string) === 'complete' && (
<div className="space-y-6 text-center">
<div className="flex justify-center">
<div className="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center">

View File

@ -1,7 +1,7 @@
"use client"
import { Button } from "@/components/ui/button"
import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar"
import { Badge } from "@/components/ui/badge"
import { AuthLayout } from "./auth-layout"
import { Package, ShoppingCart, ArrowLeft, Truck, Building2 } from "lucide-react"

View File

@ -46,10 +46,7 @@ export function ConfirmationStep({ data, onConfirm, onBack }: ConfirmationStepPr
return phone || "+7 (___) ___-__-__"
}
const formatApiKey = (key?: string) => {
if (!key) return ""
return key.substring(0, 4) + "•".repeat(key.length - 8) + key.substring(key.length - 4)
}
const handleConfirm = async () => {
setIsLoading(true)

View File

@ -1,16 +1,16 @@
"use client"
import { useState, useEffect, useRef } from "react"
import { useState } from "react"
import { Button } from "@/components/ui/button"
import { GlassInput } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Checkbox } from "@/components/ui/checkbox"
import { AuthLayout } from "./auth-layout"
import { Key, ArrowLeft, ShoppingCart, Check, X } from "lucide-react"
import { ArrowLeft, ShoppingCart, Check, X } from "lucide-react"
import { Badge } from "@/components/ui/badge"
import { useMutation } from '@apollo/client'
import { ADD_MARKETPLACE_API_KEY } from '@/graphql/mutations'
import { getAuthToken } from '@/lib/apollo-client'
interface ApiValidationData {
sellerId?: string
@ -110,7 +110,7 @@ export function MarketplaceApiStep({ onNext, onBack }: MarketplaceApiStepProps)
})
}
}
} catch (error: unknown) {
} catch {
setValidationStates(prev => ({
...prev,
[marketplace]: {

View File

@ -5,7 +5,7 @@ import { Button } from "@/components/ui/button"
import { GlassInput } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Badge } from "@/components/ui/badge"
import { Alert, AlertDescription } from "@/components/ui/alert"
import { AuthLayout } from "./auth-layout"
import { MessageSquare, ArrowLeft, Clock, RefreshCw, Check } from "lucide-react"
import { useMutation } from '@apollo/client'
@ -26,7 +26,7 @@ export function SmsStep({ phone, onNext, onBack }: SmsStepProps) {
const [error, setError] = useState<string | null>(null)
const inputRefs = useRef<(HTMLInputElement | null)[]>([])
const { verifySmsCode, checkAuth } = useAuth()
const { verifySmsCode } = useAuth()
const [sendSmsCode] = useMutation(SEND_SMS_CODE)
// Автофокус на первое поле при загрузке