react-frontend-common-components 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +85 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +26 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +34 -0
- package/rollup.config.js +44 -0
- package/src/components/app-avatar/app-avatar.tsx +24 -0
- package/src/components/app-back-arrow/app-back-arrow.css +17 -0
- package/src/components/app-back-arrow/app-back-arrow.tsx +30 -0
- package/src/components/app-badge/app-badge.css +11 -0
- package/src/components/app-badge/app-badge.tsx +44 -0
- package/src/components/app-bread-crumb/app-bread-crumb.tsx +16 -0
- package/src/components/app-button/app-button.css +13 -0
- package/src/components/app-button/app-button.tsx +51 -0
- package/src/components/app-card/app-card.css +8 -0
- package/src/components/app-card/app-card.tsx +43 -0
- package/src/components/app-carousel/app-carousel.css +68 -0
- package/src/components/app-carousel/app-carousel.tsx +62 -0
- package/src/components/app-chart/app-chart.css +6 -0
- package/src/components/app-chart/app-chart.tsx +97 -0
- package/src/components/app-checkbox-text/app-checkbox-text.css +12 -0
- package/src/components/app-checkbox-text/app-checkbox-text.tsx +20 -0
- package/src/components/app-collapse/app-collapse.tsx +57 -0
- package/src/components/app-custom-loader/app-custom-loader.css +116 -0
- package/src/components/app-custom-loader/app-custom-loader.tsx +23 -0
- package/src/components/app-divider/app-divider.tsx +16 -0
- package/src/components/app-float-button/app-float-button.tsx +23 -0
- package/src/components/app-image-box/app-image-box.css +23 -0
- package/src/components/app-image-box/app-image-box.tsx +38 -0
- package/src/components/app-input/app-input.css +61 -0
- package/src/components/app-input/app-input.tsx +89 -0
- package/src/components/app-label/app-label.css +5 -0
- package/src/components/app-label/app-label.tsx +34 -0
- package/src/components/app-list/app-list.tsx +26 -0
- package/src/components/app-loader/app-loader.css +16 -0
- package/src/components/app-loader/app-loader.tsx +28 -0
- package/src/components/app-location-map/app-location-map.css +4 -0
- package/src/components/app-location-map/app-location-map.tsx +62 -0
- package/src/components/app-modal/app-modal.css +35 -0
- package/src/components/app-modal/app-modal.tsx +58 -0
- package/src/components/app-otp-field/app-otp-field.css +31 -0
- package/src/components/app-otp-field/app-otp-field.tsx +70 -0
- package/src/components/app-pagination/app-pagination.tsx +40 -0
- package/src/components/app-password-input/app-password-input.css +41 -0
- package/src/components/app-password-input/app-password-input.tsx +79 -0
- package/src/components/app-phone-field/app-phone-field.css +61 -0
- package/src/components/app-phone-field/app-phone-field.tsx +60 -0
- package/src/components/app-popover/app-popover.css +5 -0
- package/src/components/app-popover/app-popover.tsx +45 -0
- package/src/components/app-progress/app-progress.tsx +40 -0
- package/src/components/app-radio-group/app-radio-group.css +6 -0
- package/src/components/app-radio-group/app-radio-group.tsx +45 -0
- package/src/components/app-select/app-select.css +21 -0
- package/src/components/app-select/app-select.tsx +53 -0
- package/src/components/app-select-add/app-select-add.css +21 -0
- package/src/components/app-select-add/app-select-add.tsx +34 -0
- package/src/components/app-sidebar/app-sidebar.css +46 -0
- package/src/components/app-sidebar/app-sidebar.tsx +60 -0
- package/src/components/app-tab/app-tab.css +22 -0
- package/src/components/app-tab/app-tab.tsx +31 -0
- package/src/components/app-table/app-table.tsx +42 -0
- package/src/components/app-tag/app-tag.css +11 -0
- package/src/components/app-tag/app-tag.tsx +48 -0
- package/src/components/app-textarea/app-textarea.css +19 -0
- package/src/components/app-textarea/app-textarea.tsx +59 -0
- package/src/components/app-title/app-title.css +12 -0
- package/src/components/app-title/app-title.tsx +28 -0
- package/src/components/app-toggle-button/app-toggle-button.css +27 -0
- package/src/components/app-toggle-button/app-toggle-button.tsx +43 -0
- package/src/components/app-upload-image/app-upload-image.css +26 -0
- package/src/components/app-upload-image/app-upload-image.tsx +90 -0
- package/src/components/over-view-card/over-view-card.css +16 -0
- package/src/components/over-view-card/over-view-card.tsx +22 -0
- package/src/index.ts +5 -0
- package/src/themes/icons/icons.tsx +131 -0
- package/src/themes/images/profile-img.svg +14 -0
- package/tsconfig.json +20 -0
@@ -0,0 +1,116 @@
|
|
1
|
+
.wrapper {
|
2
|
+
width: 100vw;
|
3
|
+
height: 100vh;
|
4
|
+
position: fixed;
|
5
|
+
top: 0;
|
6
|
+
left: 0;
|
7
|
+
background-color: (0, 0, 0, 0.3);
|
8
|
+
backdrop-filter: blur(10px);
|
9
|
+
display: flex;
|
10
|
+
z-index: 99;
|
11
|
+
}
|
12
|
+
|
13
|
+
/*code for custom loading icon*/
|
14
|
+
|
15
|
+
.loader {
|
16
|
+
position: relative;
|
17
|
+
width: 80px;
|
18
|
+
margin-left: 45%;
|
19
|
+
margin-top: 25%;
|
20
|
+
}
|
21
|
+
|
22
|
+
.loader span {
|
23
|
+
display: block;
|
24
|
+
transform-origin: 40px 40px;
|
25
|
+
animation: ding 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
26
|
+
}
|
27
|
+
|
28
|
+
.loader span::before {
|
29
|
+
content: "";
|
30
|
+
position: absolute;
|
31
|
+
width: 5px;
|
32
|
+
height: 5px;
|
33
|
+
border-radius: 50%;
|
34
|
+
background: rgb(0, 0, 0);
|
35
|
+
margin: -4px 0 0 -4px;
|
36
|
+
}
|
37
|
+
|
38
|
+
.loader span:nth-child(1) {
|
39
|
+
animation-delay: -0.36s;
|
40
|
+
}
|
41
|
+
|
42
|
+
.loader span:nth-child(1):before {
|
43
|
+
top: 63px;
|
44
|
+
left: 63px;
|
45
|
+
}
|
46
|
+
|
47
|
+
.loader span:nth-child(2) {
|
48
|
+
animation-delay: -0.72s;
|
49
|
+
}
|
50
|
+
|
51
|
+
.loader span:nth-child(2):before {
|
52
|
+
top: 68px;
|
53
|
+
left: 56px;
|
54
|
+
}
|
55
|
+
|
56
|
+
.loader span:nth-child(3) {
|
57
|
+
animation-delay: -0.108s;
|
58
|
+
}
|
59
|
+
|
60
|
+
.loader span:nth-child(3):before {
|
61
|
+
top: 71px;
|
62
|
+
left: 48px;
|
63
|
+
}
|
64
|
+
.loader span:nth-child(4) {
|
65
|
+
animation-delay: -0.144s;
|
66
|
+
}
|
67
|
+
|
68
|
+
.loader span:nth-child(4):before {
|
69
|
+
top: 72px;
|
70
|
+
left: 40px;
|
71
|
+
}
|
72
|
+
|
73
|
+
.loader span:nth-child(5) {
|
74
|
+
animation-delay: -0.18;
|
75
|
+
}
|
76
|
+
|
77
|
+
.loader span:nth-child(5):before {
|
78
|
+
top: 71px;
|
79
|
+
left: 32px;
|
80
|
+
}
|
81
|
+
|
82
|
+
.loader span:nth-child(6) {
|
83
|
+
animation-delay: -0.216s;
|
84
|
+
}
|
85
|
+
|
86
|
+
.loader span:nth-child(6):before {
|
87
|
+
top: 68px;
|
88
|
+
left: 24px;
|
89
|
+
}
|
90
|
+
|
91
|
+
.loader span:nth-child(7) {
|
92
|
+
animation-delay: -0.252s;
|
93
|
+
}
|
94
|
+
|
95
|
+
.loader span:nth-child(7):before {
|
96
|
+
top: 63px;
|
97
|
+
left: 17px;
|
98
|
+
}
|
99
|
+
|
100
|
+
.loader span:nth-child(8) {
|
101
|
+
animation-delay: -0.288s;
|
102
|
+
}
|
103
|
+
|
104
|
+
.loader span:nth-child(8):before {
|
105
|
+
top: 56px;
|
106
|
+
left: 12px;
|
107
|
+
}
|
108
|
+
|
109
|
+
@keyframes ding {
|
110
|
+
0% {
|
111
|
+
transform: rotate(0deg);
|
112
|
+
}
|
113
|
+
100% {
|
114
|
+
transform: rotate(360deg);
|
115
|
+
}
|
116
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import "./app-custom-loader.css";
|
2
|
+
|
3
|
+
interface AppCustomLoaderProps {
|
4
|
+
className?: string;
|
5
|
+
}
|
6
|
+
|
7
|
+
const AppCustomLoader = ({ className }: AppCustomLoaderProps) => {
|
8
|
+
return (
|
9
|
+
<div className={`wrapper ${className}`}>
|
10
|
+
<div className={"loader"}>
|
11
|
+
<span></span>
|
12
|
+
<span></span>
|
13
|
+
<span></span>
|
14
|
+
<span></span>
|
15
|
+
<span></span>
|
16
|
+
<span></span>
|
17
|
+
<span></span>
|
18
|
+
<span></span>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
);
|
22
|
+
};
|
23
|
+
export default AppCustomLoader;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Divider, DividerProps } from "antd";
|
3
|
+
|
4
|
+
interface AppDividerProps extends DividerProps {
|
5
|
+
className?: string;
|
6
|
+
}
|
7
|
+
|
8
|
+
const AppDivider = ({ className, ...props }: AppDividerProps) => {
|
9
|
+
return (
|
10
|
+
<div className={className}>
|
11
|
+
<Divider {...props} />
|
12
|
+
</div>
|
13
|
+
);
|
14
|
+
};
|
15
|
+
|
16
|
+
export default AppDivider;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { FloatButton, FloatButtonProps } from "antd";
|
3
|
+
|
4
|
+
interface AppFloatButtonProps extends FloatButtonProps {
|
5
|
+
className?: string;
|
6
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
7
|
+
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement>;
|
8
|
+
}
|
9
|
+
|
10
|
+
const AppFloatButton = ({
|
11
|
+
className,
|
12
|
+
onClick,
|
13
|
+
onMouseEnter,
|
14
|
+
...props
|
15
|
+
}: AppFloatButtonProps) => {
|
16
|
+
return (
|
17
|
+
<div className={className}>
|
18
|
+
<FloatButton {...props} onClick={onClick} onMouseEnter={onMouseEnter} />
|
19
|
+
</div>
|
20
|
+
);
|
21
|
+
};
|
22
|
+
|
23
|
+
export default AppFloatButton;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
.appImageBox {
|
2
|
+
width: max-content;
|
3
|
+
display: flex;
|
4
|
+
flex-direction: column;
|
5
|
+
align-items: center;
|
6
|
+
gap: 1rem;
|
7
|
+
|
8
|
+
.ant-image {
|
9
|
+
border-radius: 50%;
|
10
|
+
overflow: hidden;
|
11
|
+
|
12
|
+
.ant-image-img {
|
13
|
+
border-radius: 50%;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
.text {
|
17
|
+
font-size: 16px;
|
18
|
+
font-weight: 700;
|
19
|
+
line-height: 20px;
|
20
|
+
text-align: left;
|
21
|
+
color: #000000;
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Image } from "antd";
|
3
|
+
import "./app-image-box.css";
|
4
|
+
|
5
|
+
interface ImageType {
|
6
|
+
src: string;
|
7
|
+
}
|
8
|
+
|
9
|
+
interface AppImageBoxProps {
|
10
|
+
width?: number;
|
11
|
+
height?: number;
|
12
|
+
text?: string;
|
13
|
+
image: ImageType;
|
14
|
+
className?: string;
|
15
|
+
}
|
16
|
+
|
17
|
+
const AppImageBox = ({
|
18
|
+
width = 100,
|
19
|
+
height = 100,
|
20
|
+
text = "",
|
21
|
+
image,
|
22
|
+
className,
|
23
|
+
}: AppImageBoxProps) => {
|
24
|
+
return (
|
25
|
+
<div className={`appImageBox ${className}`}>
|
26
|
+
<Image
|
27
|
+
preview={false}
|
28
|
+
width={width}
|
29
|
+
height={height}
|
30
|
+
src={image.src}
|
31
|
+
alt={text}
|
32
|
+
/>
|
33
|
+
{text && <span className={"text"}>{text}</span>}
|
34
|
+
</div>
|
35
|
+
);
|
36
|
+
};
|
37
|
+
|
38
|
+
export default AppImageBox;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
.appInput {
|
2
|
+
font-size: var(--font-14);
|
3
|
+
font-weight: 500;
|
4
|
+
color: #1e1f21;
|
5
|
+
.ant-input::placeholder {
|
6
|
+
color: #202123 !important;
|
7
|
+
font-size: 14px;
|
8
|
+
font-weight: 500;
|
9
|
+
line-height: 14px;
|
10
|
+
text-align: left;
|
11
|
+
}
|
12
|
+
|
13
|
+
*:focus {
|
14
|
+
outline: 0 !important;
|
15
|
+
box-shadow: unset !important;
|
16
|
+
}
|
17
|
+
&:hover {
|
18
|
+
.ant-input {
|
19
|
+
border-color: #d9d9d9;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
&:has(.ant-input-affix-wrapper) {
|
24
|
+
.ant-input {
|
25
|
+
border: none !important;
|
26
|
+
height: unset !important;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
.ant-input-affix-wrapper {
|
30
|
+
height: 40px;
|
31
|
+
display: flex;
|
32
|
+
align-items: center;
|
33
|
+
.ant-input-outlined:focus-within {
|
34
|
+
box-shadow: unset !important;
|
35
|
+
}
|
36
|
+
|
37
|
+
*:focus {
|
38
|
+
outline: 0 !important;
|
39
|
+
box-shadow: unset !important;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
.ant-input-outlined {
|
43
|
+
height: 40px;
|
44
|
+
&:hover {
|
45
|
+
border-color: #d9d9d9;
|
46
|
+
}
|
47
|
+
&:focus {
|
48
|
+
box-shadow: unset;
|
49
|
+
}
|
50
|
+
&:focus-within {
|
51
|
+
box-shadow: unset;
|
52
|
+
border-color: #d9d9d9;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
.error {
|
58
|
+
color: red;
|
59
|
+
font-size: 0.875rem;
|
60
|
+
margin-top: 0.25rem;
|
61
|
+
}
|
@@ -0,0 +1,89 @@
|
|
1
|
+
"use client";
|
2
|
+
|
3
|
+
import { Input, InputRef } from "antd";
|
4
|
+
import {
|
5
|
+
ChangeEventHandler,
|
6
|
+
KeyboardEventHandler,
|
7
|
+
MouseEventHandler,
|
8
|
+
useEffect,
|
9
|
+
useRef,
|
10
|
+
} from "react";
|
11
|
+
import "./app-input.css";
|
12
|
+
|
13
|
+
interface AppInputProps {
|
14
|
+
className?: string;
|
15
|
+
label?: string;
|
16
|
+
name?: string;
|
17
|
+
value?: string;
|
18
|
+
dataTestId?: string;
|
19
|
+
id?: string;
|
20
|
+
disabled?: boolean;
|
21
|
+
handleChange?: ChangeEventHandler<HTMLInputElement>;
|
22
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
23
|
+
onPressEnter?: KeyboardEventHandler<HTMLInputElement>;
|
24
|
+
defaultValue?: string;
|
25
|
+
isAutoFocus?: boolean;
|
26
|
+
triggerFocus?: boolean;
|
27
|
+
type?: string;
|
28
|
+
isOptional?: boolean;
|
29
|
+
errorMessage?: string;
|
30
|
+
suffixIcon?: React.ReactNode;
|
31
|
+
prefixIcon?: React.ReactNode;
|
32
|
+
}
|
33
|
+
|
34
|
+
const AppInput = ({
|
35
|
+
className,
|
36
|
+
label,
|
37
|
+
name,
|
38
|
+
value,
|
39
|
+
dataTestId,
|
40
|
+
type,
|
41
|
+
id,
|
42
|
+
disabled,
|
43
|
+
handleChange,
|
44
|
+
onClick,
|
45
|
+
defaultValue,
|
46
|
+
onPressEnter,
|
47
|
+
isAutoFocus,
|
48
|
+
triggerFocus,
|
49
|
+
isOptional,
|
50
|
+
errorMessage,
|
51
|
+
suffixIcon,
|
52
|
+
prefixIcon,
|
53
|
+
}: AppInputProps) => {
|
54
|
+
const inputRef = useRef<InputRef>(null);
|
55
|
+
|
56
|
+
useEffect(() => {
|
57
|
+
if (isAutoFocus && inputRef.current) {
|
58
|
+
inputRef.current.focus();
|
59
|
+
}
|
60
|
+
}, [triggerFocus, isAutoFocus]);
|
61
|
+
|
62
|
+
const placeholder = isOptional ? `${label} (optional)` : label;
|
63
|
+
|
64
|
+
return (
|
65
|
+
<div className={`appInput ${className}`}>
|
66
|
+
<Input
|
67
|
+
type={type}
|
68
|
+
data-test-id={dataTestId}
|
69
|
+
id={id}
|
70
|
+
disabled={disabled}
|
71
|
+
name={name}
|
72
|
+
className={"input"}
|
73
|
+
value={value}
|
74
|
+
onChange={handleChange}
|
75
|
+
onClick={onClick}
|
76
|
+
defaultValue={defaultValue}
|
77
|
+
onPressEnter={onPressEnter}
|
78
|
+
placeholder={placeholder}
|
79
|
+
ref={inputRef}
|
80
|
+
prefix={prefixIcon && prefixIcon}
|
81
|
+
suffix={suffixIcon && suffixIcon}
|
82
|
+
/>
|
83
|
+
|
84
|
+
{errorMessage && <div className={"error"}>{errorMessage}</div>}
|
85
|
+
</div>
|
86
|
+
);
|
87
|
+
};
|
88
|
+
|
89
|
+
export default AppInput;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import "./app-label.css";
|
2
|
+
|
3
|
+
interface AppLabelProps {
|
4
|
+
text: string;
|
5
|
+
htmlFor?: string;
|
6
|
+
color?: string;
|
7
|
+
fontSize?: string;
|
8
|
+
className?: string;
|
9
|
+
}
|
10
|
+
|
11
|
+
const AppLabel = ({
|
12
|
+
text,
|
13
|
+
htmlFor,
|
14
|
+
color = "inherit",
|
15
|
+
fontSize = "inherit",
|
16
|
+
className,
|
17
|
+
}: AppLabelProps) => {
|
18
|
+
const labelStyle = {
|
19
|
+
color,
|
20
|
+
fontSize,
|
21
|
+
};
|
22
|
+
|
23
|
+
return (
|
24
|
+
<label
|
25
|
+
htmlFor={htmlFor}
|
26
|
+
className={`label ${className}`}
|
27
|
+
style={labelStyle}
|
28
|
+
>
|
29
|
+
{text}
|
30
|
+
</label>
|
31
|
+
);
|
32
|
+
};
|
33
|
+
|
34
|
+
export default AppLabel;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { List, ListProps } from "antd";
|
3
|
+
|
4
|
+
interface AppListProps<T> extends ListProps<T> {
|
5
|
+
renderItem: (item: T, index: number) => React.ReactNode;
|
6
|
+
className?: string;
|
7
|
+
}
|
8
|
+
|
9
|
+
const AppList = <T extends unknown>({
|
10
|
+
renderItem,
|
11
|
+
dataSource,
|
12
|
+
className,
|
13
|
+
...props
|
14
|
+
}: AppListProps<T>) => {
|
15
|
+
return (
|
16
|
+
<div className={className}>
|
17
|
+
<List
|
18
|
+
dataSource={dataSource}
|
19
|
+
renderItem={(item, index) => renderItem(item, index)}
|
20
|
+
{...props}
|
21
|
+
/>
|
22
|
+
</div>
|
23
|
+
);
|
24
|
+
};
|
25
|
+
|
26
|
+
export default AppList;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
.loader {
|
2
|
+
width: 100vw;
|
3
|
+
height: 100vh;
|
4
|
+
display: grid;
|
5
|
+
place-items: center;
|
6
|
+
|
7
|
+
position: fixed;
|
8
|
+
top: 0;
|
9
|
+
left: 0;
|
10
|
+
background-color: (0, 0, 0, 0.3);
|
11
|
+
backdrop-filter: blur(10px);
|
12
|
+
z-index: 99;
|
13
|
+
* {
|
14
|
+
transform: scale(1.5);
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Spin, Skeleton } from "antd";
|
3
|
+
import "./app-loader.css";
|
4
|
+
|
5
|
+
type LoaderType = "spinner" | "skeleton" | "custom";
|
6
|
+
|
7
|
+
interface AppLoaderProps {
|
8
|
+
type?: LoaderType;
|
9
|
+
customLoader?: React.ReactNode;
|
10
|
+
className?: string;
|
11
|
+
}
|
12
|
+
|
13
|
+
const AppLoader = ({ type, customLoader, className }: AppLoaderProps) => {
|
14
|
+
const loaderType: LoaderType = customLoader ? "custom" : type || "spinner";
|
15
|
+
|
16
|
+
switch (loaderType) {
|
17
|
+
case "spinner":
|
18
|
+
return <Spin className={`loader ${className}`} />;
|
19
|
+
case "skeleton":
|
20
|
+
return <Skeleton active className={`loader ${className}`} />;
|
21
|
+
case "custom":
|
22
|
+
return customLoader || <Spin className={`loader ${className}`} />;
|
23
|
+
default:
|
24
|
+
return <Spin className={`loader ${className}`} />;
|
25
|
+
}
|
26
|
+
};
|
27
|
+
|
28
|
+
export default AppLoader;
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
2
|
+
import { GoogleMap, LoadScript } from "@react-google-maps/api";
|
3
|
+
import "./app-location-map.css";
|
4
|
+
|
5
|
+
interface LatLng {
|
6
|
+
lat: number;
|
7
|
+
lng: number;
|
8
|
+
}
|
9
|
+
|
10
|
+
interface LocationMapProps {
|
11
|
+
cityId?: LatLng;
|
12
|
+
className?: string;
|
13
|
+
containerStyle?: React.CSSProperties;
|
14
|
+
clickableIcons?: boolean;
|
15
|
+
zoom?: number;
|
16
|
+
mapKey: string;
|
17
|
+
}
|
18
|
+
|
19
|
+
const AppLocationMap = ({
|
20
|
+
cityId,
|
21
|
+
className,
|
22
|
+
containerStyle,
|
23
|
+
clickableIcons,
|
24
|
+
zoom = 10,
|
25
|
+
mapKey,
|
26
|
+
}: LocationMapProps) => {
|
27
|
+
const [center, setCenter] = useState<LatLng | null>(null);
|
28
|
+
|
29
|
+
useEffect(() => {
|
30
|
+
if (cityId) {
|
31
|
+
setCenter(cityId);
|
32
|
+
} else {
|
33
|
+
if (navigator.geolocation) {
|
34
|
+
navigator.geolocation.getCurrentPosition((position) => {
|
35
|
+
setCenter({
|
36
|
+
lat: position.coords.latitude,
|
37
|
+
lng: position.coords.longitude,
|
38
|
+
});
|
39
|
+
});
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}, [cityId]);
|
43
|
+
|
44
|
+
return (
|
45
|
+
<div className={`appLocationMap ${className}`}>
|
46
|
+
<LoadScript googleMapsApiKey={mapKey}>
|
47
|
+
<div style={containerStyle}>
|
48
|
+
{center && (
|
49
|
+
<GoogleMap
|
50
|
+
mapContainerStyle={containerStyle}
|
51
|
+
center={center}
|
52
|
+
clickableIcons={clickableIcons}
|
53
|
+
zoom={zoom}
|
54
|
+
/>
|
55
|
+
)}
|
56
|
+
</div>
|
57
|
+
</LoadScript>
|
58
|
+
</div>
|
59
|
+
);
|
60
|
+
};
|
61
|
+
|
62
|
+
export default AppLocationMap;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
.header {
|
2
|
+
width: 100%;
|
3
|
+
padding: 0 16px;
|
4
|
+
}
|
5
|
+
|
6
|
+
.title,
|
7
|
+
.titleLeft {
|
8
|
+
font-size: 1rem;
|
9
|
+
font-weight: 500;
|
10
|
+
text-align: center;
|
11
|
+
flex-grow: 1;
|
12
|
+
}
|
13
|
+
|
14
|
+
.titleLeft {
|
15
|
+
text-align: left;
|
16
|
+
}
|
17
|
+
|
18
|
+
.descriptionLeft {
|
19
|
+
text-align: left;
|
20
|
+
}
|
21
|
+
|
22
|
+
.closeButton {
|
23
|
+
align-self: flex-end;
|
24
|
+
}
|
25
|
+
|
26
|
+
.body {
|
27
|
+
text-align: center;
|
28
|
+
}
|
29
|
+
|
30
|
+
.footer {
|
31
|
+
margin-top: 16px;
|
32
|
+
display: flex;
|
33
|
+
justify-content: center;
|
34
|
+
width: 100%;
|
35
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Modal, Button } from "antd";
|
3
|
+
import { CloseOutlined } from "@ant-design/icons";
|
4
|
+
import "./app-modal.css";
|
5
|
+
|
6
|
+
interface AppModalProps {
|
7
|
+
visible: boolean;
|
8
|
+
onClose: () => void;
|
9
|
+
title?: string;
|
10
|
+
description?: string;
|
11
|
+
children: React.ReactNode;
|
12
|
+
footerButtons?: React.ReactNode;
|
13
|
+
alignTitleLeft?: boolean;
|
14
|
+
className?: string;
|
15
|
+
closeIcon?: React.ReactNode;
|
16
|
+
}
|
17
|
+
|
18
|
+
const AppModal = ({
|
19
|
+
visible,
|
20
|
+
onClose,
|
21
|
+
title,
|
22
|
+
description,
|
23
|
+
children,
|
24
|
+
footerButtons,
|
25
|
+
alignTitleLeft = false,
|
26
|
+
className,
|
27
|
+
closeIcon,
|
28
|
+
}: AppModalProps) => {
|
29
|
+
return (
|
30
|
+
<div className={`AppModal ${className}`}>
|
31
|
+
<Modal
|
32
|
+
open={visible}
|
33
|
+
onCancel={onClose}
|
34
|
+
footer={null}
|
35
|
+
closeIcon={closeIcon || <CloseOutlined />}
|
36
|
+
className={"modal"}
|
37
|
+
>
|
38
|
+
<div className={"header"}>
|
39
|
+
{title && (
|
40
|
+
<div className={alignTitleLeft ? "titleLeft" : "title"}>
|
41
|
+
{title}
|
42
|
+
</div>
|
43
|
+
)}
|
44
|
+
{description && (
|
45
|
+
<div className={alignTitleLeft ? "descriptionLeft" : "description"}>
|
46
|
+
{description}
|
47
|
+
</div>
|
48
|
+
)}
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div className={"body"}>{children}</div>
|
52
|
+
{footerButtons && <div className={"footer"}>{footerButtons}</div>}
|
53
|
+
</Modal>
|
54
|
+
</div>
|
55
|
+
);
|
56
|
+
};
|
57
|
+
|
58
|
+
export default AppModal;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
.appOtpField {
|
2
|
+
.otpInputStyle {
|
3
|
+
gap: 0.5rem;
|
4
|
+
& input {
|
5
|
+
margin: 0 5px;
|
6
|
+
font-size: 24px;
|
7
|
+
border-radius: 10px;
|
8
|
+
border: none;
|
9
|
+
width: 3.125rem !important;
|
10
|
+
height: 2.6875rem !important;
|
11
|
+
background-color: #f6f7f9 !important;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
.resendWrap {
|
15
|
+
margin-top: 1rem;
|
16
|
+
& .forgotPassword {
|
17
|
+
font-size: 0.875rem;
|
18
|
+
font-style: normal;
|
19
|
+
font-weight: 500;
|
20
|
+
line-height: 150%;
|
21
|
+
letter-spacing: -0.0175rem;
|
22
|
+
cursor: pointer;
|
23
|
+
.resendTimer {
|
24
|
+
color: rgb(255, 0, 0);
|
25
|
+
}
|
26
|
+
.resendBtn {
|
27
|
+
color: #009046;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|