Skip to content

Commit 1db063e

Browse files
Merge pull request #71 from azawert/fix/booking-flow
Fix/booking flow
2 parents f2d31a6 + a1a1c94 commit 1db063e

File tree

58 files changed

+1675
-597
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1675
-597
lines changed

src/assets/Icons/AttentionYellow.tsx

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,37 @@ import { TIconProps } from "./types"
22
import { memo } from "react"
33

44
const Component: React.FC<TIconProps> = props => {
5-
const { width = 20, height = 20, ...rest } = props
6-
return (
7-
<svg
8-
width="24"
9-
height="24"
10-
viewBox="0 0 24 24"
11-
fill="none"
12-
xmlns="http://www.w3.org/2000/svg"
13-
{...rest}
14-
>
15-
<rect width="24" height="24" rx="12" fill="#FFC107" />
16-
<path d="M12 13.0504C11.754 13.0504 11.55 12.8464 11.55 12.6004V9.60039C11.55 9.35439 11.754 9.15039 12 9.15039C12.246 9.15039 12.45 9.35439 12.45 9.60039V12.6004C12.45 12.8464 12.246 13.0504 12 13.0504Z" fill="#181A1A" stroke="#181A1A" stroke-width="0.3" />
17-
<path d="M12.0001 15.0003C11.9641 15.0003 11.9221 14.9943 11.8801 14.9883C11.8441 14.9823 11.8081 14.9703 11.7721 14.9523C11.7361 14.9403 11.7001 14.9223 11.6641 14.8983C11.6341 14.8743 11.6041 14.8503 11.5741 14.8263C11.4661 14.7123 11.4001 14.5563 11.4001 14.4003C11.4001 14.2443 11.4661 14.0883 11.5741 13.9743C11.6041 13.9503 11.6341 13.9263 11.6641 13.9023C11.7001 13.8783 11.7361 13.8603 11.7721 13.8483C11.8081 13.8303 11.8441 13.8183 11.8801 13.8123C11.9581 13.7943 12.0421 13.7943 12.1141 13.8123C12.1561 13.8183 12.1921 13.8303 12.2281 13.8483C12.2641 13.8603 12.3001 13.8783 12.3361 13.9023C12.3661 13.9263 12.3961 13.9503 12.4261 13.9743C12.5341 14.0883 12.6001 14.2443 12.6001 14.4003C12.6001 14.5563 12.5341 14.7123 12.4261 14.8263C12.3961 14.8503 12.3661 14.8743 12.3361 14.8983C12.3001 14.9223 12.2641 14.9403 12.2281 14.9523C12.1921 14.9703 12.1561 14.9823 12.1141 14.9883C12.0781 14.9943 12.0361 15.0003 12.0001 15.0003Z" fill="#181A1A" stroke="#181A1A" stroke-width="0.3" />
18-
<path d="M15.6359 17.4957H8.36394C7.19394 17.4957 6.29994 17.0697 5.84394 16.3017C5.39394 15.5337 5.45394 14.5437 6.02394 13.5177L9.65994 6.97771C10.2599 5.89771 11.0879 5.30371 11.9999 5.30371C12.9119 5.30371 13.7399 5.89771 14.3399 6.97771L17.9759 13.5237C18.5459 14.5497 18.6119 15.5337 18.1559 16.3077C17.6999 17.0697 16.8059 17.4957 15.6359 17.4957ZM11.9999 6.20371C11.4359 6.20371 10.8839 6.63571 10.4459 7.41571L6.81594 13.9617C6.40794 14.6937 6.34194 15.3657 6.62394 15.8517C6.90594 16.3377 7.52994 16.6017 8.36994 16.6017H15.6419C16.4819 16.6017 17.0999 16.3377 17.3879 15.8517C17.6759 15.3657 17.6039 14.6997 17.1959 13.9617L13.5539 7.41571C13.1159 6.63571 12.5639 6.20371 11.9999 6.20371Z" fill="#181A1A" stroke="#181A1A" stroke-width="0.3" />
19-
</svg>
20-
21-
)
5+
const { width = 20, height = 20, ...rest } = props
6+
return (
7+
<svg
8+
width={width}
9+
height={height}
10+
viewBox="0 0 24 24"
11+
fill="none"
12+
xmlns="http://www.w3.org/2000/svg"
13+
{...rest}
14+
>
15+
<rect width="24" height="24" rx="12" fill="#FFC107" />
16+
<path
17+
d="M12 13.0504C11.754 13.0504 11.55 12.8464 11.55 12.6004V9.60039C11.55 9.35439 11.754 9.15039 12 9.15039C12.246 9.15039 12.45 9.35439 12.45 9.60039V12.6004C12.45 12.8464 12.246 13.0504 12 13.0504Z"
18+
fill="#181A1A"
19+
stroke="#181A1A"
20+
stroke-width="0.3"
21+
/>
22+
<path
23+
d="M12.0001 15.0003C11.9641 15.0003 11.9221 14.9943 11.8801 14.9883C11.8441 14.9823 11.8081 14.9703 11.7721 14.9523C11.7361 14.9403 11.7001 14.9223 11.6641 14.8983C11.6341 14.8743 11.6041 14.8503 11.5741 14.8263C11.4661 14.7123 11.4001 14.5563 11.4001 14.4003C11.4001 14.2443 11.4661 14.0883 11.5741 13.9743C11.6041 13.9503 11.6341 13.9263 11.6641 13.9023C11.7001 13.8783 11.7361 13.8603 11.7721 13.8483C11.8081 13.8303 11.8441 13.8183 11.8801 13.8123C11.9581 13.7943 12.0421 13.7943 12.1141 13.8123C12.1561 13.8183 12.1921 13.8303 12.2281 13.8483C12.2641 13.8603 12.3001 13.8783 12.3361 13.9023C12.3661 13.9263 12.3961 13.9503 12.4261 13.9743C12.5341 14.0883 12.6001 14.2443 12.6001 14.4003C12.6001 14.5563 12.5341 14.7123 12.4261 14.8263C12.3961 14.8503 12.3661 14.8743 12.3361 14.8983C12.3001 14.9223 12.2641 14.9403 12.2281 14.9523C12.1921 14.9703 12.1561 14.9823 12.1141 14.9883C12.0781 14.9943 12.0361 15.0003 12.0001 15.0003Z"
24+
fill="#181A1A"
25+
stroke="#181A1A"
26+
stroke-width="0.3"
27+
/>
28+
<path
29+
d="M15.6359 17.4957H8.36394C7.19394 17.4957 6.29994 17.0697 5.84394 16.3017C5.39394 15.5337 5.45394 14.5437 6.02394 13.5177L9.65994 6.97771C10.2599 5.89771 11.0879 5.30371 11.9999 5.30371C12.9119 5.30371 13.7399 5.89771 14.3399 6.97771L17.9759 13.5237C18.5459 14.5497 18.6119 15.5337 18.1559 16.3077C17.6999 17.0697 16.8059 17.4957 15.6359 17.4957ZM11.9999 6.20371C11.4359 6.20371 10.8839 6.63571 10.4459 7.41571L6.81594 13.9617C6.40794 14.6937 6.34194 15.3657 6.62394 15.8517C6.90594 16.3377 7.52994 16.6017 8.36994 16.6017H15.6419C16.4819 16.6017 17.0999 16.3377 17.3879 15.8517C17.6759 15.3657 17.6039 14.6997 17.1959 13.9617L13.5539 7.41571C13.1159 6.63571 12.5639 6.20371 11.9999 6.20371Z"
30+
fill="#181A1A"
31+
stroke="#181A1A"
32+
stroke-width="0.3"
33+
/>
34+
</svg>
35+
)
2236
}
2337

2438
export const AttentionYellow = memo(Component)

src/assets/Icons/DeletePetIcon.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { memo } from "react"
2+
import { TIconProps } from "./types"
3+
4+
const Component: React.FC<TIconProps> = props => {
5+
const { width = 16, height = 16, ...rest } = props
6+
return (
7+
<svg
8+
width={width}
9+
height={height}
10+
{...rest}
11+
viewBox="0 0 32 32"
12+
fill="none"
13+
xmlns="http://www.w3.org/2000/svg"
14+
>
15+
<rect x="0.5" y="0.5" width="31" height="31" rx="15.5" stroke="#757575" />
16+
<path
17+
d="M18.885 11.7575L16 14.6425L13.115 11.7575C12.6907 11.3332 12.0968 11.4181 11.7573 11.7575C11.4179 12.0969 11.3331 12.6909 11.7573 13.1151L14.7272 16.085L11.8422 18.97C11.4179 19.2245 11.4179 19.9033 11.7573 20.2428C12.0968 20.5822 12.6907 20.667 13.115 20.2428L16.0848 17.2729L19.0547 20.2428C19.2244 20.5822 19.9032 20.5822 20.2426 20.2428C20.582 19.9033 20.6669 19.3094 20.2426 18.8851L17.3576 16.0001L20.3275 13.0303C20.6669 12.6909 20.582 12.0969 20.2426 11.7575C19.9032 11.4181 19.3092 11.3332 18.885 11.7575Z"
18+
fill="#181A1A"
19+
/>
20+
</svg>
21+
)
22+
}
23+
24+
export const DeletePetIcon = memo(Component)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { memo } from "react"
2+
import { TIconProps } from "./types"
3+
4+
const Component: React.FC<TIconProps> = props => {
5+
const { width = 16, height = 16, ...rest } = props
6+
return (
7+
<svg
8+
width={width}
9+
height={height}
10+
viewBox="0 0 32 32"
11+
fill="none"
12+
xmlns="http://www.w3.org/2000/svg"
13+
{...rest}
14+
>
15+
<rect x="0.5" y="0.5" width="31" height="31" rx="15.5" stroke="#757575" />
16+
<path
17+
d="M12 16H20"
18+
stroke="#181A1A"
19+
stroke-width="1.5"
20+
stroke-linecap="round"
21+
stroke-linejoin="round"
22+
/>
23+
<path
24+
d="M16 20V12"
25+
stroke="#181A1A"
26+
stroke-width="1.5"
27+
stroke-linecap="round"
28+
stroke-linejoin="round"
29+
/>
30+
</svg>
31+
)
32+
}
33+
34+
export const RoundedPlusIcon = memo(Component)

src/assets/Icons/SearchIcon.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { TIconProps } from "./types"
2+
import { memo } from "react"
3+
4+
const Component: React.FC<TIconProps> = props => {
5+
const { width = 20, height = 20, ...rest } = props
6+
return (
7+
<svg
8+
width={width}
9+
height={height}
10+
viewBox="0 0 16 16"
11+
fill="none"
12+
xmlns="http://www.w3.org/2000/svg"
13+
{...rest}
14+
>
15+
<g clipPath="url(#clip0_4136_1067)">
16+
<path
17+
d="M7.33333 13.6667C10.8311 13.6667 13.6667 10.8311 13.6667 7.33333C13.6667 3.83553 10.8311 1 7.33333 1C3.83553 1 1 3.83553 1 7.33333C1 10.8311 3.83553 13.6667 7.33333 13.6667Z"
18+
stroke="#181A1A"
19+
strokeWidth="1.5"
20+
strokeLinecap="round"
21+
strokeLinejoin="round"
22+
/>
23+
<path
24+
d="M14.3333 14.3333L13 13"
25+
stroke="#181A1A"
26+
strokeWidth="1.5"
27+
strokeLinecap="round"
28+
strokeLinejoin="round"
29+
/>
30+
</g>
31+
<defs>
32+
<clipPath id="clip0_4136_1067">
33+
<rect width="16" height="16" fill="white" />
34+
</clipPath>
35+
</defs>
36+
</svg>
37+
)
38+
}
39+
40+
export const SearchIcon = memo(Component)

src/assets/Icons/types.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ import { DownArrowIcon } from "./DownArrowIcon"
1717
import { AttentionYellow } from "./AttentionYellow"
1818
import { AttentionBlue } from "./AttentionBlue"
1919
import { AttentionRed } from "./AttentionRed"
20-
20+
import { DeletePetIcon } from "./DeletePetIcon"
21+
import { RoundedPlusIcon } from "./RoundedPlusIcon"
22+
import { SearchIcon } from "./SearchIcon"
2123

2224
export type TIcon =
2325
| "PlusIcon"
@@ -39,7 +41,9 @@ export type TIcon =
3941
| "AttentionYellow"
4042
| "AttentionBlue"
4143
| "AttentionRed"
42-
44+
| "DeletePetIcon"
45+
| "RoundedPlusIcon"
46+
| "SearchIcon"
4347
export type TIconProps = SVGProps<SVGSVGElement>
4448

4549
export const iconTypes = new Map<TIcon, React.JSX.Element>([
@@ -61,4 +65,7 @@ export const iconTypes = new Map<TIcon, React.JSX.Element>([
6165
["AttentionYellow", <AttentionYellow key={"AttentionYellow"} />],
6266
["AttentionBlue", <AttentionBlue key={"AttentionBlue"} />],
6367
["AttentionRed", <AttentionRed key={"AttentionRed"} />],
68+
["DeletePetIcon", <DeletePetIcon key={"DeletePetIcon"} />],
69+
["RoundedPlusIcon", <RoundedPlusIcon key={"RoundedPlusIcon"} />],
70+
["SearchIcon", <SearchIcon key={"SearchIcon"} />],
6471
])

src/assets/images/logo.png

6.22 KB
Loading

src/generated/owners.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ export interface OwnerDto {
483483
/** Имя клиента */
484484
firstName?: string
485485
/** Id клиента */
486-
id?: number
486+
id: number
487487
/** Фамилия клиента */
488488
lastName?: string
489489
/** Основной номер телефона клиента */
@@ -495,7 +495,7 @@ export interface OwnerDto {
495495
/** Прочие контакты клиента */
496496
otherContacts?: string
497497
/** Список питомцев клиента */
498-
petsDto?: PetDtoForOwner[]
498+
petsDto: PetDtoForOwner[]
499499
/** Рейтинг клиента */
500500
rating?: number
501501
/** Дата регистрации клиента */
@@ -713,7 +713,7 @@ export const searchOwner = (
713713
params?: SearchOwnerParams,
714714
options?: SecondParameter<typeof axiosInstance>
715715
) => {
716-
return axiosInstance<OwnerDto>(
716+
return axiosInstance<OwnerDto[]>(
717717
{
718718
url: `/owners/search`,
719719
method: "POST",

src/modules/Authorization/pages/AuthorizationPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { useForm, SubmitHandler } from "react-hook-form"
2-
import { EMAIL_VALIDATION_PATTERN, TAuthUser } from "../const"
32

43
import { Box, Avatar, Typography } from "@mui/material"
54
import { TextField } from "@/shared/ui/TextField"
65
import { Button, EButtonSize, EButtonVariant } from "@/shared/ui/Button/Button"
76
import { useDocumentTitle } from "@/shared/hooks/useDocumentTitle"
7+
import { TAuthUser } from "@/modules/Booking/const"
8+
import { EMAIL_VALIDATION_PATTERN } from "@/modules/Employee/const"
89

910
export const AuthorizationPage: React.FC = () => {
1011
useDocumentTitle({ title: "Авторизация" })

src/modules/Booking/components/form/blocks/CategoryForm/CategoryRoomsForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const CategoryRoomsForm = (props: CategoryRoomsProps) => {
2828
render={({ field }) => {
2929
return (
3030
<CategorySelect
31-
className="w-60"
31+
className="w-64"
3232
onChange={field.onChange}
3333
value={bookingData.categories || field.value || ""}
3434
error={errors?.categories?.message}

src/modules/Booking/components/form/blocks/CommentForm/CommentForm.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
IComment,
44
} from "@/modules/Booking/model/types/BookingValidationSchema"
55
import { TextField } from "@/shared/ui/TextField"
6-
import { DeepPartial, UseFormReturn } from "react-hook-form"
6+
import { Controller, DeepPartial, UseFormReturn } from "react-hook-form"
77

88
interface CommentFormProps {
99
form: UseFormReturn<IComment>
@@ -12,15 +12,21 @@ interface CommentFormProps {
1212

1313
export const CommentForm = (props: CommentFormProps) => {
1414
const { form } = props
15-
const { register } = form
15+
const { control } = form
1616
return (
17-
<TextField
18-
id="comment"
19-
placeholder="Комментарий"
20-
label="Комментарий"
21-
isTextarea
22-
width={541}
23-
{...register("comment")}
17+
<Controller
18+
control={control}
19+
name={"comment"}
20+
render={({ field }) => (
21+
<TextField
22+
id="comment"
23+
placeholder="Комментарий"
24+
label="Комментарий"
25+
isTextarea
26+
width={541}
27+
{...field}
28+
/>
29+
)}
2430
/>
2531
)
2632
}

0 commit comments

Comments
 (0)