linter fixes
This commit is contained in:
@@ -5,7 +5,11 @@ import TextInput from './ui/TextInput'
|
||||
import axios from 'axios'
|
||||
import { useRouter } from 'next/navigation'
|
||||
|
||||
export default function AddressSelector() {
|
||||
interface AddressSelectorProps {
|
||||
is_search?: boolean
|
||||
}
|
||||
|
||||
export default function AddressSelector({ is_search }: AddressSelectorProps) {
|
||||
const router = useRouter()
|
||||
const [fromAddress, setFromAddress] = useState('')
|
||||
const [toAddress, setToAddress] = useState('')
|
||||
@@ -75,6 +79,7 @@ export default function AddressSelector() {
|
||||
|
||||
return (
|
||||
<div className="my-2 w-full rounded-xl bg-white p-4 shadow-lg sm:my-4 sm:p-6">
|
||||
{is_search && <h2 className="mb-4 text-lg font-bold">Может поищем по городу?</h2>}
|
||||
<div className="flex flex-col gap-4 sm:flex-row sm:items-end sm:gap-3">
|
||||
<div className="w-full min-w-0 sm:flex-[3] sm:px-1">
|
||||
<TextInput
|
||||
@@ -109,7 +114,7 @@ export default function AddressSelector() {
|
||||
<button
|
||||
onClick={() => handleSearch('mover')}
|
||||
disabled={isLoading}
|
||||
className={`w-full rounded-2xl p-4 text-center whitespace-nowrap text-white sm:w-auto sm:flex-1 ${
|
||||
className={`w-full cursor-pointer rounded-2xl p-4 text-center whitespace-nowrap text-white sm:w-auto sm:flex-1 ${
|
||||
isLoading ? 'bg-orange/50 cursor-not-allowed' : 'bg-orange hover:bg-orange/80'
|
||||
}`}
|
||||
>
|
||||
@@ -118,7 +123,7 @@ export default function AddressSelector() {
|
||||
<button
|
||||
onClick={() => handleSearch('customer')}
|
||||
disabled={isLoading}
|
||||
className={`w-full rounded-2xl p-4 text-center whitespace-nowrap sm:w-auto sm:flex-1 ${
|
||||
className={`w-full cursor-pointer rounded-2xl p-4 text-center whitespace-nowrap sm:w-auto sm:flex-1 ${
|
||||
isLoading
|
||||
? 'cursor-not-allowed bg-gray-100 text-gray-400'
|
||||
: 'bg-gray-100 text-gray-800 hover:bg-gray-200'
|
||||
|
||||
@@ -62,14 +62,14 @@ const LeadPopup = ({ id, isOpen, onClose, onSuccess }: LeadPopupProps) => {
|
||||
//форма инициализируется до того, как данные пользователя загружаются из стора, поэтому нужно обновлять значения формы при загрузке данных пользователя
|
||||
useEffect(() => {
|
||||
if (user) {
|
||||
setValues({
|
||||
...values,
|
||||
setValues(prev => ({
|
||||
...prev,
|
||||
name: user.name,
|
||||
phone_number: user.phone_number || '',
|
||||
email: user.email || '',
|
||||
})
|
||||
}))
|
||||
}
|
||||
}, [user])
|
||||
}, [user, setValues])
|
||||
|
||||
return (
|
||||
<Modal title="Откликнуться на заявку" isOpen={isOpen} onClose={onClose}>
|
||||
|
||||
Reference in New Issue
Block a user