linter fixes
This commit is contained in:
@@ -10,16 +10,13 @@ import ClientView from './ClientView'
|
||||
const LoginPage = () => {
|
||||
const router = useRouter()
|
||||
const { isAuthenticated } = useUserStore()
|
||||
const [isClient, setIsClient] = useState(true)
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
|
||||
useEffect(() => {
|
||||
// проверяем логин
|
||||
if (isAuthenticated) {
|
||||
// распределяем
|
||||
if (isClient) {
|
||||
router.replace('/account')
|
||||
}
|
||||
router.replace('/account')
|
||||
return
|
||||
}
|
||||
|
||||
@@ -28,18 +25,18 @@ const LoginPage = () => {
|
||||
}, 300)
|
||||
|
||||
return () => clearTimeout(timer)
|
||||
}, [isAuthenticated, router, isClient])
|
||||
}, [isAuthenticated, router])
|
||||
|
||||
if (isLoading) {
|
||||
return <Loader />
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-center py-8 ">
|
||||
<div className="flex w-full max-w-xl flex-col gap-4 bg-white rounded-2xl shadow-lg p-6">
|
||||
<div className="flex items-center justify-center py-8">
|
||||
<div className="flex w-full max-w-xl flex-col gap-4 rounded-2xl bg-white p-6 shadow-lg">
|
||||
<div className="flex flex-col items-center py-4">
|
||||
<h1 className="text-2xl font-medium pb-1">Рады видеть Вас снова!</h1>
|
||||
<p className="text-base font-medium text-center">
|
||||
<h1 className="pb-1 text-2xl font-medium">Рады видеть Вас снова!</h1>
|
||||
<p className="text-center text-base font-medium">
|
||||
Пожалуйста, авторизуйтесь, чтобы продолжить
|
||||
</p>
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5,27 +5,35 @@ import Link from 'next/link'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import useUserStore from '@/app/store/userStore'
|
||||
import ClientRegistrationForm from './components/ClientRegistrationForm'
|
||||
import Loader from '@/components/ui/Loader'
|
||||
|
||||
const RegisterPage = () => {
|
||||
const router = useRouter()
|
||||
const { isAuthenticated } = useUserStore()
|
||||
const [isClient, setIsClient] = useState(true)
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
|
||||
useEffect(() => {
|
||||
// проверяем логин
|
||||
if (isAuthenticated) {
|
||||
// распределяем
|
||||
if (isClient) {
|
||||
router.replace('/account')
|
||||
}
|
||||
router.replace('/account')
|
||||
return
|
||||
}
|
||||
}, [isAuthenticated, router, isClient])
|
||||
|
||||
const timer = setTimeout(() => {
|
||||
setIsLoading(false)
|
||||
}, 300)
|
||||
|
||||
return () => clearTimeout(timer)
|
||||
}, [isAuthenticated, router])
|
||||
|
||||
if (isLoading) {
|
||||
return <Loader />
|
||||
}
|
||||
return (
|
||||
<div className="flex items-center justify-center p-12">
|
||||
<div className="flex w-full max-w-xl md:max-w-3xl lg:max-w-3xl flex-col gap-4 bg-white rounded-2xl shadow-lg p-6">
|
||||
<h1 className="text-2xl py-1">Давайте познакомимся поближе!</h1>
|
||||
<div className="flex w-full max-w-xl flex-col gap-4 rounded-2xl bg-white p-6 shadow-lg md:max-w-3xl lg:max-w-3xl">
|
||||
<h1 className="py-1 text-2xl">Давайте познакомимся поближе!</h1>
|
||||
|
||||
<ClientRegistrationForm />
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import React from 'react'
|
||||
import type { Metadata } from 'next'
|
||||
import SearchCard from '../../components/SearchCard'
|
||||
import { SearchCardProps, RouteSearchPageProps } from '@/app/types'
|
||||
import SearchFilters from '../../components/SearchFilters'
|
||||
import { RouteSearchPageProps } from '@/app/types'
|
||||
import ClientResults from '../../components/ClientResults'
|
||||
|
||||
async function fetchSearch(category: string, from: string, to: string) {
|
||||
|
||||
@@ -4,6 +4,7 @@ import SearchCard from '../components/SearchCard'
|
||||
import { SearchCardProps, SearchPageProps } from '@/app/types'
|
||||
import { fetchRoutes } from '@/lib/search/fetchRoutes'
|
||||
import SearchFilters from '../components/SearchFilters'
|
||||
import AddressSelector from '@/components/AddressSelector'
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
return {
|
||||
@@ -56,8 +57,11 @@ export default async function SearchPage(props: SearchPageProps) {
|
||||
return (
|
||||
<div className="container mx-auto p-4">
|
||||
<h1 className="mb-4 text-2xl font-bold">
|
||||
{params.category === 'mover' ? 'Поиск перевозчика' : 'Поиск посылки'}
|
||||
{params.category === 'mover'
|
||||
? 'Поиск перевозчика - все предложения'
|
||||
: 'Поиск посылки - все предложения'}
|
||||
</h1>
|
||||
<AddressSelector is_search={true} />
|
||||
<SearchFilters />
|
||||
<Suspense fallback={<div>Загрузка результатов...</div>}>
|
||||
<div className="space-y-4">
|
||||
|
||||
Reference in New Issue
Block a user