Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
zango-frontend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit c45eea89
authored
2024-06-27 14:44:49 +0530
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
changes
1 parent
c0cbf072
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
278 additions
and
55 deletions
components/common-components/OtpTimer.js
components/detail/Detail.js
components/detail/DetailInfo.js
components/gift-card/GiftCard.js
components/listing/ListingFilter.js
components/listing/ListingItems.js
components/signup/Signup.js
redux/actions/activityAction.js
redux/actions/userActions.js
styles/globals.css
yarn.lock
components/common-components/OtpTimer.js
0 → 100644
View file @
c45eea8
import
Image
from
"next/image"
;
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
{
toast
}
from
"react-toastify"
;
import
{
registerEndUser
,
registerVendor
}
from
"../../redux/actions/userActions"
;
import
{
renderImage
}
from
"../../services/imageHandling"
;
const
OtpTimer
=
({
initialTime
,
role
,
userData
})
=>
{
const
[
timeLeft
,
setTimeLeft
]
=
useState
(
initialTime
);
const
[
isDisabled
,
setIsDisabled
]
=
useState
(
true
);
useEffect
(()
=>
{
if
(
timeLeft
===
0
)
{
setIsDisabled
(
false
);
return
;
}
const
timerId
=
setInterval
(()
=>
{
setTimeLeft
(
prevTime
=>
prevTime
-
1
);
},
1000
);
return
()
=>
clearInterval
(
timerId
);
},
[
timeLeft
]);
const
handleResend
=
async
()
=>
{
setTimeLeft
(
initialTime
);
setIsDisabled
(
true
);
if
(
role
==
"user"
)
{
await
registerEndUser
(
userData
);
}
if
(
role
==
"vendor"
)
{
await
registerVendor
(
userData
);
}
toast
.
success
(
"OTP has been sent again."
);
// if (onResend) {
// onResend();
// }
};
const
formatTime
=
seconds
=>
{
const
minutes
=
Math
.
floor
(
seconds
/
60
);
const
secs
=
seconds
%
60
;
return
`
${
minutes
}
:
${
secs
<
10
?
"0"
:
""
}${
secs
}
`
;
};
return
(
<
div
>
<
p
>
Resend
OTP
in
:
{
formatTime
(
timeLeft
)}
<
/p
>
<
button
className
=
"d-flex resend-otp"
onClick
=
{
handleResend
}
disabled
=
{
isDisabled
}
>
Resend
OTP
<
/button
>
{
/* <div className="d-flex resend-otp">
<span className="image-container me-2">
<Image src={renderImage("/images/login/icon-resend.png")} layout="fill" className="image" />
</span>
<p className="mb-0">Resend</p>
</div> */
}
<
/div
>
);
};
export
default
OtpTimer
;
components/detail/Detail.js
View file @
c45eea8
...
@@ -41,7 +41,7 @@ const Detail = () => {
...
@@ -41,7 +41,7 @@ const Detail = () => {
separatorMargin
:
20
,
separatorMargin
:
20
,
fontWeight
:
500
,
fontWeight
:
500
,
fontSize
:
16
,
fontSize
:
16
,
fontFamily
:
'Sofia Pro'
,
fontFamily
:
"Sofia Pro"
}
}
}
}
}}
}}
...
@@ -50,20 +50,20 @@ const Detail = () => {
...
@@ -50,20 +50,20 @@ const Detail = () => {
separator
=
{
<
RightOutlined
/>
}
separator
=
{
<
RightOutlined
/>
}
items
=
{[
items
=
{[
{
{
title
:
'Home'
,
title
:
"Home"
,
href
:
'/'
href
:
"/"
},
},
{
{
title
:
activityById
?.
data
?.
attributes
?.
vendor
?.
data
?.
attributes
?.
city
,
title
:
activityById
?.
data
?.
attributes
?.
vendor
?.
data
?.
attributes
?.
city
},
},
{
{
title
:
activityById
?.
data
?.
attributes
?.
category
?.
data
?.
attributes
?.
name
,
title
:
activityById
?.
data
?.
attributes
?.
category
?.
data
?.
attributes
?.
name
,
href
:
`/listing?category=
${
activityById
?.
data
.
attributes
.
category
?.
data
?.
id
}
`
,
href
:
`/listing?category=
${
activityById
?.
data
.
attributes
.
category
?.
data
?.
id
}
`
},
},
{
{
title: activityById?.data?.attributes?.name,
title: activityById?.data?.attributes?.name,
href: `
/
listing
?
category
=
$
{
activityById
?.
data
.
attributes
.
category
?.
data
?.
id
}
`
,
href: `
/
listing
?
category
=
$
{
activityById
?.
data
.
attributes
.
category
?.
data
?.
id
}
`
}
,
}
]}
]}
/>
/>
</ConfigProvider>
</ConfigProvider>
...
@@ -91,6 +91,23 @@ const Detail = () => {
...
@@ -91,6 +91,23 @@ const Detail = () => {
<DetailSchedule activityById={activityById} />
<DetailSchedule activityById={activityById} />
</div>
</div>
</section>
</section>
{activityById && activityById.data.attributes.cancellationPolicyText && (
<div className="container">
<div className="row">
<div className="col-12 my-2">
<div className="head-btn">
<div className="head01">
<div className="title">Cancellation Policy</div>
</div>
{/* <a href="" className="view-all-reviews-btn">
View All Reviews
</a> */}
</div>
</div>
<div className="col-12 my-2">{activityById.data.attributes.cancellationPolicyText}</div>
</div>
</div>
)}
<GuestReviews activityById={activityById} />
<GuestReviews activityById={activityById} />
<SimilarExperiences allActivitiesData={allActivitiesData} />
<SimilarExperiences allActivitiesData={allActivitiesData} />
<Faqs faqs={faqs} />
<Faqs faqs={faqs} />
...
...
components/detail/DetailInfo.js
View file @
c45eea8
...
@@ -24,6 +24,17 @@ const DetailInfo = ({ activityById }) => {
...
@@ -24,6 +24,17 @@ const DetailInfo = ({ activityById }) => {
dispatch
(
getCurrentEndUser
());
dispatch
(
getCurrentEndUser
());
},
[]);
},
[]);
const
calculateRating
=
data
=>
{
let
value
=
0
;
data
.
map
(
item
=>
{
// console.log("item", item);
value
=
value
+
item
.
attributes
.
rating
;
});
// console.log("value", value);
let
length
=
data
.
length
;
return
Math
.
floor
(
value
/
length
);
};
const
[
session
,
setSession
]
=
useState
(
null
);
const
[
session
,
setSession
]
=
useState
(
null
);
const
[
enqDate
,
setenqDate
]
=
useState
();
const
[
enqDate
,
setenqDate
]
=
useState
();
const
[
loading
,
setloading
]
=
useState
(
false
);
const
[
loading
,
setloading
]
=
useState
(
false
);
...
@@ -83,9 +94,14 @@ const DetailInfo = ({ activityById }) => {
...
@@ -83,9 +94,14 @@ const DetailInfo = ({ activityById }) => {
<
/motion.div
>
<
/motion.div
>
<
/div
>
<
/div
>
<
div
className
=
"product-reviews"
>
<
div
className
=
"product-reviews"
>
<
span
className
=
"rating"
>
{
activityById
.
data
.
attributes
.
rating
}
<
/span
>
<
span
className
=
"rating"
>
<
span
className
=
"review"
>
1
,
365
Reviews
<
/span
>
<
span
className
=
"image-container"
>
<
span
className
=
"star"
>
<
Image
layout
=
"fill"
alt
=
""
className
=
"image img-fluid"
src
=
"/images/icons/star.svg"
/>
{
calculateRating
(
activityById
.
data
.
attributes
.
reviews
.
data
)}
<
/span
>
<
/span
>
<
span
className
=
"review"
>
{
activityById
.
data
.
attributes
.
reviews
.
data
.
length
>
0
?
activityById
.
data
.
attributes
.
reviews
.
data
.
length
:
0
}
<
/span
>
{
/* <span className="star">
<a href="">
<a href="">
<span className="image-container">
<span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/star.svg" />
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/star.svg" />
...
@@ -111,7 +127,7 @@ const DetailInfo = ({ activityById }) => {
...
@@ -111,7 +127,7 @@ const DetailInfo = ({ activityById }) => {
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/star.svg" />
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/star.svg" />
</span>
</span>
</a>
</a>
<
/span
>
</span> */
}
<
/div
>
<
/div
>
<
div
className
=
"mb-2"
>
Per
Person
<
/div
>
<
div
className
=
"mb-2"
>
Per
Person
<
/div
>
<
div
className
=
"price"
>
<
div
className
=
"price"
>
...
@@ -164,7 +180,6 @@ const DetailInfo = ({ activityById }) => {
...
@@ -164,7 +180,6 @@ const DetailInfo = ({ activityById }) => {
Book
Now
Book
Now
<
/Button
>
<
/Button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
)}
)}
...
...
components/gift-card/GiftCard.js
View file @
c45eea8
...
@@ -118,75 +118,75 @@ const GiftCard = () => {
...
@@ -118,75 +118,75 @@ const GiftCard = () => {
<
li
>
<
li
>
<
input
<
input
name
=
"amt"
name
=
"amt"
id
=
"amt-2
5
0"
id
=
"amt-20"
type
=
"radio"
type
=
"radio"
value
=
""
value
=
""
data
-
gtm
-
Form
-
interact
-
field
-
id
=
"1"
data
-
gtm
-
Form
-
interact
-
field
-
id
=
"1"
onChange
=
{
e
=>
{
onChange
=
{
e
=>
{
setAmount
(
2
5
0
);
setAmount
(
20
);
setcustom
(
false
);
setcustom
(
false
);
}}
}}
/
>
/
>
<
label
for
=
"amt-2
50"
>
$25
0
<
/label
>
<
label
for
=
"amt-2
0"
>
$2
0
<
/label
>
<
/li
>
<
/li
>
<
li
>
<
li
>
<
input
<
input
name
=
"amt"
name
=
"amt"
id
=
"amt-50
0
"
id
=
"amt-50"
type
=
"radio"
type
=
"radio"
value
=
""
value
=
""
data
-
gtm
-
form
-
interact
-
field
-
id
=
"1"
data
-
gtm
-
form
-
interact
-
field
-
id
=
"1"
onChange
=
{
e
=>
{
onChange
=
{
e
=>
{
setAmount
(
50
0
);
setAmount
(
50
);
setcustom
(
false
);
setcustom
(
false
);
}}
}}
/
>
/
>
<
label
for
=
"amt-50
0"
>
$50
0
<
/label
>
<
label
for
=
"amt-50
"
>
$5
0
<
/label
>
<
/li
>
<
/li
>
<
li
>
<
li
>
<
input
<
input
name
=
"amt"
name
=
"amt"
id
=
"amt-
75
0"
id
=
"amt-
10
0"
type
=
"radio"
type
=
"radio"
value
=
""
value
=
""
data
-
gtm
-
form
-
interact
-
field
-
id
=
"1"
data
-
gtm
-
form
-
interact
-
field
-
id
=
"1"
onChange
=
{
e
=>
{
onChange
=
{
e
=>
{
setAmount
(
75
0
);
setAmount
(
10
0
);
setcustom
(
false
);
setcustom
(
false
);
}}
}}
/
>
/
>
<
label
for
=
"amt-
75
0"
>
<
label
for
=
"amt-
10
0"
>
<
span
>
Most
Popular
<
/span
>
<
span
>
Most
Popular
<
/span
>
<
br
/>
$
75
0
<
br
/>
$
10
0
<
/label
>
<
/label
>
<
/li
>
<
/li
>
<
li
>
<
li
>
<
input
<
input
name
=
"amt"
name
=
"amt"
id
=
"amt-
100
0"
id
=
"amt-
25
0"
type
=
"radio"
type
=
"radio"
value
=
""
value
=
""
data
-
gtm
-
form
-
interact
-
field
-
id
=
"1"
data
-
gtm
-
form
-
interact
-
field
-
id
=
"1"
onChange
=
{
e
=>
{
onChange
=
{
e
=>
{
setAmount
(
100
0
);
setAmount
(
25
0
);
setcustom
(
false
);
setcustom
(
false
);
}}
}}
/
>
/
>
<
label
for
=
"amt-
1000"
>
$100
0
<
/label
>
<
label
for
=
"amt-
250"
>
$25
0
<
/label
>
<
/li
>
<
/li
>
<
li
>
<
li
>
<
input
<
input
name
=
"amt"
name
=
"amt"
id
=
"amt-
1
500"
id
=
"amt-500"
type
=
"radio"
type
=
"radio"
value
=
""
value
=
""
data
-
gtm
-
form
-
interact
-
field
-
id
=
"1"
data
-
gtm
-
form
-
interact
-
field
-
id
=
"1"
onChange
=
{
e
=>
{
onChange
=
{
e
=>
{
setAmount
(
1
500
);
setAmount
(
500
);
setcustom
(
false
);
setcustom
(
false
);
}}
}}
/
>
/
>
<
label
for
=
"amt-
1500"
>
$1
500
<
/label
>
<
label
for
=
"amt-
500"
>
$
500
<
/label
>
<
/li
>
<
/li
>
<
li
>
<
li
>
<
input
<
input
...
...
components/listing/ListingFilter.js
View file @
c45eea8
...
@@ -9,7 +9,7 @@ import { TimePicker } from "antd";
...
@@ -9,7 +9,7 @@ import { TimePicker } from "antd";
import
dayjs
from
"dayjs"
;
import
dayjs
from
"dayjs"
;
import
{
Input
}
from
"react-bootstrap-typeahead"
;
import
{
Input
}
from
"react-bootstrap-typeahead"
;
const
format
=
"HH:mm"
;
const
format
=
"HH:mm"
;
const
suitableAgeGroups
=
[
2
,
5
,
8
,
10
,
12
,
14
,
16
];
const
suitableAgeGroups
=
[
[
2
,
5
],
[
5
,
10
],
[
10
,
16
],
[
16
,
18
],
[
18
]
];
const
ListingFilter
=
()
=>
{
const
ListingFilter
=
()
=>
{
const
[
showContent
,
setShowContent
]
=
useState
(
false
);
const
[
showContent
,
setShowContent
]
=
useState
(
false
);
const
[
sliderLowerValue
,
setsliderLowerValue
]
=
useState
(
0
);
const
[
sliderLowerValue
,
setsliderLowerValue
]
=
useState
(
0
);
...
@@ -17,12 +17,21 @@ const ListingFilter = () => {
...
@@ -17,12 +17,21 @@ const ListingFilter = () => {
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
{
activityFilters
}
=
useSelector
(
sate
=>
sate
.
activityFilters
);
const
{
activityFilters
}
=
useSelector
(
sate
=>
sate
.
activityFilters
);
const
{
subCategories
,
loading
}
=
useSelector
(
sate
=>
sate
.
subCategories
);
const
{
subCategories
,
loading
}
=
useSelector
(
sate
=>
sate
.
subCategories
);
const
[
customDate
,
setcustomDate
]
=
useState
();
const
toggleContent
=
()
=>
{
const
toggleContent
=
()
=>
{
setShowContent
(
!
showContent
);
setShowContent
(
!
showContent
);
};
};
const
onChange
=
(
date
,
dateString
)
=>
{
const
onChange
=
(
date
,
dateString
)
=>
{
console
.
log
(
date
,
dateString
);
console
.
log
(
date
,
dateString
);
};
};
const
disabledDate
=
current
=>
{
// Can not select days before today and today
return
current
&&
current
<
dayjs
().
startOf
(
"day"
);
};
const
disabledDate2
=
(
current
,
customDate
)
=>
{
// Can not select days before today and today
return
current
&&
current
<
dayjs
(
customDate
).
startOf
(
"day"
);
};
return
(
return
(
<>
<>
<
div
className
=
"listing-filter"
>
<
div
className
=
"listing-filter"
>
...
@@ -220,7 +229,9 @@ const ListingFilter = () => {
...
@@ -220,7 +229,9 @@ const ListingFilter = () => {
<
label
>
From
<
/label
>
<
label
>
From
<
/label
>
<
Space
direction
=
"vertical"
>
<
Space
direction
=
"vertical"
>
<
DatePicker
<
DatePicker
disabledDate
=
{
disabledDate
}
onChange
=
{(
date
,
dateString
)
=>
{
onChange
=
{(
date
,
dateString
)
=>
{
setcustomDate
(
date
);
console
.
log
(
"date"
,
date
,
dateString
);
console
.
log
(
"date"
,
date
,
dateString
);
dispatch
(
setActivityFilters
({
filters
:
{
...
activityFilters
,
startDate
:
dateString
!==
""
?
dateString
:
null
}
}));
dispatch
(
setActivityFilters
({
filters
:
{
...
activityFilters
,
startDate
:
dateString
!==
""
?
dateString
:
null
}
}));
}}
}}
...
@@ -231,6 +242,7 @@ const ListingFilter = () => {
...
@@ -231,6 +242,7 @@ const ListingFilter = () => {
<
label
>
To
<
/label
>
<
label
>
To
<
/label
>
<
Space
direction
=
"vertical"
>
<
Space
direction
=
"vertical"
>
<
DatePicker
<
DatePicker
disabledDate
=
{
current
=>
disabledDate2
(
current
,
customDate
)}
onChange
=
{(
date
,
dateString
)
=>
{
onChange
=
{(
date
,
dateString
)
=>
{
console
.
log
(
"date"
,
date
,
dateString
);
console
.
log
(
"date"
,
date
,
dateString
);
dispatch
(
setActivityFilters
({
filters
:
{
...
activityFilters
,
endDate
:
dateString
!==
""
?
dateString
:
null
}
}));
dispatch
(
setActivityFilters
({
filters
:
{
...
activityFilters
,
endDate
:
dateString
!==
""
?
dateString
:
null
}
}));
...
@@ -270,7 +282,7 @@ const ListingFilter = () => {
...
@@ -270,7 +282,7 @@ const ListingFilter = () => {
<
/div
>
<
/div
>
<
div
className
=
"time"
>
<
div
className
=
"time"
>
<
div
>
<
div
>
<
label
>
m
aximum
duration
:
<
/label
>
<
label
>
M
aximum
duration
:
<
/label
>
<
/div
>
<
/div
>
<
div
className
=
""
>
<
div
className
=
""
>
<
Input
<
Input
...
@@ -360,23 +372,30 @@ const ListingFilter = () => {
...
@@ -360,23 +372,30 @@ const ListingFilter = () => {
<
div
className
=
"inner"
>
<
div
className
=
"inner"
>
<
Form
.
Select
<
Form
.
Select
onChange
=
{
e
=>
{
onChange
=
{
e
=>
{
console
.
log
(
e
.
target
.
valu
e
);
// console.log("filter 123",
e);
if
(
e
.
target
.
value
!=
"select"
)
{
if
(
e
.
target
.
value
!=
"select"
)
{
dispatch
(
setActivityFilters
({
filters
:
{
...
activityFilters
,
minAge
:
e
.
target
.
value
}
}));
dispatch
(
setActivityFilters
({
filters
:
{
...
activityFilters
,
minAge
:
e
.
target
.
value
}
}));
}
else
{
}
else
{
dispatch
(
setActivityFilters
({
filters
:
{
...
activityFilters
,
minAge
:
null
}
}));
dispatch
(
setActivityFilters
({
filters
:
{
...
activityFilters
,
minAge
:
null
}
}));
}
}
// setTimeout(() => {
// }, 1500);
}}
}}
// onSelect={(e) => {
// console.log("filter 123", e);
// }}
aria
-
label
=
"Default select example"
aria
-
label
=
"Default select example"
>
>
<
option
>
Select
<
/option
>
<
option
>
Select
<
/option
>
{
suitableAgeGroups
.
map
(
item
=>
{
{
suitableAgeGroups
.
map
(
item
=>
{
return
<
option
value
=
{
item
}
>
{
item
}
+
<
/option>
;
return
<
option
value
=
{
item
}
>
{
item
[
1
]
?
`
${
item
[
0
]}
-
${
item
[
1
]}
`
:
`
${
item
[
0
]}
+`
}
<
/option>
;
})}
})}
{
/* {[
{ start: 5, end: 10 },
{ start: 10, end: 20 }
].map(item => {
return <option value={item}> {item.end ? `${item.start} - ${item.end}` : `${item[0]}+`} </option>;
})} */
}
<
/Form.Select
>
<
/Form.Select
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
components/listing/ListingItems.js
View file @
c45eea8
...
@@ -14,6 +14,7 @@ import Link from "next/link";
...
@@ -14,6 +14,7 @@ import Link from "next/link";
const
ListingItems
=
({
allActivitiesData
,
loading
,
gridClass
,
totalCount
})
=>
{
const
ListingItems
=
({
allActivitiesData
,
loading
,
gridClass
,
totalCount
})
=>
{
// const [gridClass, setGridClass] = useState('col-md-3');
// const [gridClass, setGridClass] = useState('col-md-3');
const
{
endUser
}
=
useSelector
(
state
=>
state
.
endUser
);
const
{
endUser
}
=
useSelector
(
state
=>
state
.
endUser
);
const
{
activityFilters
}
=
useSelector
(
state
=>
state
.
activityFilters
);
const
router
=
useRouter
();
const
router
=
useRouter
();
const
[
readMoreText
,
setreadMoreText
]
=
useState
();
const
[
readMoreText
,
setreadMoreText
]
=
useState
();
const
[
showModal
,
setshowModal
]
=
useState
(
false
);
const
[
showModal
,
setshowModal
]
=
useState
(
false
);
...
@@ -49,7 +50,70 @@ const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) =>
...
@@ -49,7 +50,70 @@ const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) =>
// router.push({
// router.push({
// query: `/listing?page=${pageNumber}`
// query: `/listing?page=${pageNumber}`
// });
// });
dispatch
(
getActivitiesByFilters
({
currentPage
:
pageNumber
}));
// dispatch(getActivitiesByFilters({ currentPage: pageNumber }));
let
filters
=
{};
// console.log("subcategory here", activityFilters.startDate);
if
(
activityFilters
.
category
)
{
filters
[
"category"
]
=
{
id
:
{
$eq
:
activityFilters
.
category
}
};
}
if
(
activityFilters
.
subCategories
?.
length
>
0
)
{
filters
[
"category"
]
=
null
;
filters
[
"subCategory"
]
=
activityFilters
.
subCategories
.
map
(
item
=>
{
return
{
subCategory
:
{
id
:
{
$eq
:
item
}
}
};
});
}
if
(
activityFilters
.
activityType
)
{
filters
[
"activityType"
]
=
activityFilters
.
activityType
;
}
if
(
activityFilters
.
startDate
)
{
filters
[
"fromDate"
]
=
activityFilters
.
startDate
;
}
if
(
activityFilters
.
endDate
)
{
filters
[
"toDate"
]
=
activityFilters
.
endDate
;
}
if
(
activityFilters
.
minDuration
>
0
)
{
filters
[
"minimumDuration"
]
=
activityFilters
.
minDuration
;
}
if
(
activityFilters
.
maxDuration
>
0
)
{
filters
[
"maximumDuration"
]
=
activityFilters
.
maxDuration
;
}
if
(
activityFilters
.
minGroupSize
>
0
)
{
filters
[
"minGroupSize"
]
=
activityFilters
.
minGroupSize
;
}
if
(
activityFilters
.
maxGroupSize
>
0
)
{
filters
[
"maxGroupSize"
]
=
activityFilters
.
maxGroupSize
;
}
if
(
activityFilters
.
minAge
>
0
)
{
filters
[
"ageLowerLimit"
]
=
activityFilters
.
minAge
;
}
if
(
activityFilters
.
sorting
)
{
filters
[
"sort"
]
=
activityFilters
.
sorting
;
}
if
(
activityFilters
.
priceUpperLimit
)
{
filters
[
"priceUpperLimit"
]
=
activityFilters
.
priceUpperLimit
;
}
if
(
activityFilters
.
priceLowerLimit
)
{
filters
[
"priceLowerLimit"
]
=
activityFilters
.
priceLowerLimit
;
}
console
.
log
(
"router query"
,
filters
.
category
);
dispatch
(
getActivitiesByFilters
({
subCategory
:
filters
.
subCategory
,
category
:
filters
.
category
,
activityType
:
filters
.
activityType
,
fromDate
:
filters
.
fromDate
,
toDate
:
filters
.
toDate
,
minimumDuration
:
filters
.
minimumDuration
,
maximumDuration
:
filters
.
maximumDuration
,
minGroupSize
:
filters
.
minGroupSize
,
maxGroupSize
:
filters
.
maxGroupSize
,
ageLowerLimit
:
filters
.
ageLowerLimit
,
sort
:
filters
.
sort
,
priceUpperLimit
:
filters
.
priceUpperLimit
,
priceLowerLimit
:
filters
.
priceLowerLimit
,
currentPage
:
pageNumber
})
);
};
};
console
.
log
(
"page"
,
page
);
console
.
log
(
"page"
,
page
);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
...
components/signup/Signup.js
View file @
c45eea8
...
@@ -16,11 +16,14 @@ import { finishVendorOtpVerification } from "../../redux/actions/vendorActions";
...
@@ -16,11 +16,14 @@ import { finishVendorOtpVerification } from "../../redux/actions/vendorActions";
import
{
signIn
}
from
"next-auth/react"
;
import
{
signIn
}
from
"next-auth/react"
;
import
{
Loader
}
from
"react-bootstrap-typeahead"
;
import
{
Loader
}
from
"react-bootstrap-typeahead"
;
import
qs
from
"qs"
;
import
qs
from
"qs"
;
import
PhoneInput
from
"react-phone-input-2"
;
import
OtpTimer
from
"../common-components/OtpTimer"
;
const
Signup
=
props
=>
{
const
Signup
=
props
=>
{
console
.
log
(
"props.type"
,
props
.
type
);
console
.
log
(
"props.type"
,
props
.
type
);
const
[
otp
,
setOtp
]
=
useState
(
new
Array
(
4
).
fill
(
""
));
const
[
otp
,
setOtp
]
=
useState
(
new
Array
(
4
).
fill
(
""
));
const
[
isOtpSent
,
setOtpSent
]
=
useState
(
false
);
const
[
isOtpSent
,
setOtpSent
]
=
useState
(
false
);
const
[
otpVerified
,
setOtpVerified
]
=
useState
(
false
);
const
[
otpVerified
,
setOtpVerified
]
=
useState
(
false
);
const
[
otpTimer
,
setotpTimer
]
=
useState
(
30
);
const
[
loading
,
setLoading
]
=
useState
();
const
[
loading
,
setLoading
]
=
useState
();
const
dispatch
=
useDispatch
();
const
dispatch
=
useDispatch
();
const
router
=
useRouter
();
const
router
=
useRouter
();
...
@@ -42,9 +45,8 @@ const Signup = props => {
...
@@ -42,9 +45,8 @@ const Signup = props => {
.
required
(
"Confirm Password is Required"
)
.
required
(
"Confirm Password is Required"
)
.
oneOf
([
Yup
.
ref
(
"password"
),
null
],
"Passwords must match"
),
.
oneOf
([
Yup
.
ref
(
"password"
),
null
],
"Passwords must match"
),
countryCode
:
Yup
.
string
().
required
(
"Country Code is Required"
),
countryCode
:
Yup
.
string
().
required
(
"Country Code is Required"
),
mobile
:
Yup
.
string
()
mobile
:
Yup
.
string
().
required
(
"Mobile Number is Required"
),
.
required
(
"Mobile Number is Required"
)
// .matches(/^[0-9\s]+$/, "Please Enter Correct Mobile No."),
.
matches
(
/^
[
0-9
\s]
+$/
,
"Please Enter Correct Mobile No."
),
termsConditions
:
Yup
.
bool
().
oneOf
([
true
],
"Please Accept Terms & Conditions"
),
termsConditions
:
Yup
.
bool
().
oneOf
([
true
],
"Please Accept Terms & Conditions"
),
otp
:
Yup
.
string
().
when
(
"isOtpSent"
,
{
otp
:
Yup
.
string
().
when
(
"isOtpSent"
,
{
is
:
true
,
is
:
true
,
...
@@ -73,7 +75,13 @@ const Signup = props => {
...
@@ -73,7 +75,13 @@ const Signup = props => {
if
(
props
.
type
==
"user"
)
{
if
(
props
.
type
==
"user"
)
{
}
}
};
};
const
startTimer
=
()
=>
{
setotpTimer
(
otpTimer
-
1
);
// while (otpTimer > 0) {
// setTimeout(() => {
// }, 1000);
// }
};
return
(
return
(
<
Fragment
>
<
Fragment
>
<
div
className
=
"contaier-fluid login-banner-image"
>
<
div
className
=
"contaier-fluid login-banner-image"
>
...
@@ -109,7 +117,7 @@ const Signup = props => {
...
@@ -109,7 +117,7 @@ const Signup = props => {
// }
// }
// }}
// }}
>
>
{({
values
,
errors
,
touched
,
handleChange
,
handleBlur
,
handleSubmit
,
isValid
,
isSubmitting
})
=>
(
{({
values
,
errors
,
touched
,
handleChange
,
handleBlur
,
handleSubmit
,
isValid
,
isSubmitting
,
setValues
,
setFieldValue
})
=>
(
<
Form
<
Form
onSubmit
=
{
async
e
=>
{
onSubmit
=
{
async
e
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -160,6 +168,7 @@ const Signup = props => {
...
@@ -160,6 +168,7 @@ const Signup = props => {
}
}
setOtpSent
(
true
);
setOtpSent
(
true
);
setLoading
(
false
);
setLoading
(
false
);
// startTimer();
}
else
{
}
else
{
e
.
preventDefault
();
e
.
preventDefault
();
setLoading
(
true
);
setLoading
(
true
);
...
@@ -220,14 +229,21 @@ const Signup = props => {
...
@@ -220,14 +229,21 @@ const Signup = props => {
<
div
className
=
"input-group"
>
<
div
className
=
"input-group"
>
<
label
>
Mobile
No
.
<
/label
>
<
label
>
Mobile
No
.
<
/label
>
<
div
className
=
"contact-numbe w-100"
>
<
div
className
=
"contact-numbe w-100"
>
<
input
{
/* <input name="mobile" onChange={handleChange} onBlur={handleBlur} value={values.mobile} placeholder="" style={{ flex: "0 100%" }} /> */
}
type
=
"text"
<
PhoneInput
placeholder
=
"Enter phone number"
name
=
"mobile"
name
=
"mobile"
onChange
=
{
handleChange
}
onChange
=
{
e
=>
{
console
.
log
(
values
.
mobile
);
setValues
({
...
values
,
mobile
:
e
});
// handleChange(e);
}}
onBlur
=
{
handleBlur
}
onBlur
=
{
handleBlur
}
value
=
{
values
.
mobile
}
value
=
{
values
.
mobile
}
placeholder
=
"#@$!%@#"
// placeholder=""
style
=
{{
flex
:
"0 100%"
}}
// style={{ flex: "0 100%" }}
// value={value}
// onChange={setValue}
/
>
/
>
<
/div
>
<
/div
>
{
errors
.
mobile
&&
touched
.
mobile
&&
<
span
className
=
"form-error"
>
{
errors
.
mobile
}
<
/span>
}
{
errors
.
mobile
&&
touched
.
mobile
&&
<
span
className
=
"form-error"
>
{
errors
.
mobile
}
<
/span>
}
...
@@ -250,18 +266,28 @@ const Signup = props => {
...
@@ -250,18 +266,28 @@ const Signup = props => {
{
errors
.
termsConditions
&&
touched
.
termsConditions
&&
<
span
className
=
"form-error"
>
{
errors
.
termsConditions
}
<
/span>
}
{
errors
.
termsConditions
&&
touched
.
termsConditions
&&
<
span
className
=
"form-error"
>
{
errors
.
termsConditions
}
<
/span>
}
<
/div
>
<
/div
>
{
isOtpSent
&&
(
{
isOtpSent
&&
(
// true
<>
<>
<
div
className
=
"input-group"
>
<
div
className
=
"input-group"
>
<
label
>
{
/* <label>
OTP
<
span
style
=
{{
marginLeft
:
"190px"
}}
>
00
:
30
<
/span
>
OTP <span style={{ marginLeft: "190px" }}>{otpTimer}</span>
<
/label
>
</label> */
}
<
div
className
=
"otp-input"
>
<
div
className
=
"otp-input"
>
<
OTPInput
setOtp
=
{
setOtp
}
otp
=
{
otp
}
/
>
<
OTPInput
setOtp
=
{
setOtp
}
otp
=
{
otp
}
/
>
<
/div
>
<
/div
>
{
errors
.
otp
&&
touched
.
otp
&&
<
span
className
=
"form-error"
>
{
errors
.
otp
}
<
/span>
}
{
errors
.
otp
&&
touched
.
otp
&&
<
span
className
=
"form-error"
>
{
errors
.
otp
}
<
/span>
}
<
/div
>
<
/div
>
<
div
>
<
div
>
<
p
>
4
digit
OTP
is
been
sent
on
your
email
address
.
<
/p
>
{
/* <p>OTP Timer Example</p> */
}
<
OtpTimer
initialTime
=
{
30
}
role
=
{
props
.
type
}
userData
=
{{
mobileNo
:
values
.
mobile
,
name
:
values
.
fullname
,
email
:
values
.
email
,
password
:
values
.
password
}}
/
>
<
/div
>
<
div
>
<
p
className
=
"mt-4"
>
4
digit
OTP
is
been
sent
on
your
email
address
.
<
/p
>
<
div
className
=
"d-flex align-items-center mb-4"
>
<
div
className
=
"d-flex align-items-center mb-4"
>
<
p
className
=
"mb-0 me-5"
>
Didn
’
t
Receive
Yet
?
<
/p
>
<
p
className
=
"mb-0 me-5"
>
Didn
’
t
Receive
Yet
?
<
/p
>
{
/* <div className="d-flex resend-otp">
{
/* <div className="d-flex resend-otp">
...
...
redux/actions/activityAction.js
View file @
c45eea8
...
@@ -113,7 +113,7 @@ export const getActivitiesByVendor = () => async dispatch => {
...
@@ -113,7 +113,7 @@ export const getActivitiesByVendor = () => async dispatch => {
}
}
},
},
pagination
:
{
pagination
:
{
pageSize
:
1000
,
pageSize
:
1000
},
},
populate
:
[
populate
:
[
"masterMonths"
,
"masterMonths"
,
...
@@ -274,7 +274,7 @@ export const getActivitiesForAdmin =
...
@@ -274,7 +274,7 @@ export const getActivitiesForAdmin =
}
}
},
},
pagination
:
{
pagination
:
{
pageSize
:
1000
,
pageSize
:
1000
},
},
populate
:
[
populate
:
[
"masterMonths"
,
"masterMonths"
,
...
@@ -335,7 +335,7 @@ export const getActivitiesForEndUser = () => async dispatch => {
...
@@ -335,7 +335,7 @@ export const getActivitiesForEndUser = () => async dispatch => {
filters
:
{
filters
:
{
approved
:
{
$eq
:
"approved"
}
approved
:
{
$eq
:
"approved"
}
},
},
sort
:
[{
createdAt
:
'asc'
}],
sort
:
[{
createdAt
:
"asc"
}],
pagination
:
{
pagination
:
{
pageSize
:
5
pageSize
:
5
},
},
...
@@ -463,8 +463,10 @@ export const getActivitiesByFilters =
...
@@ -463,8 +463,10 @@ export const getActivitiesByFilters =
query
.
filters
[
"activityType"
]
=
activityType
;
query
.
filters
[
"activityType"
]
=
activityType
;
}
}
// { fromDate: {$lte: "2022-07-09"}}
if
(
fromDate
&&
toDate
)
{
if
(
fromDate
&&
toDate
)
{
query
.
filters
[
"$and"
]
=
[{
fromDate
:
{
$gte
:
fromDate
}
},
{
toDate
:
{
$lte
:
toDate
}
}];
query
.
filters
[
"$and"
]
=
[{
fromDate
:
{
$gte
:
fromDate
}
},
{
toDate
:
{
$lte
:
toDate
}
}];
// query.filters["$or"] = [{ fromDate: { $gte: fromDate } }, { toDate: { $lte: toDate } }];
delete
query
.
filters
.
fromDate
;
delete
query
.
filters
.
fromDate
;
delete
query
.
filters
.
toDate
;
delete
query
.
filters
.
toDate
;
}
}
...
@@ -477,12 +479,28 @@ export const getActivitiesByFilters =
...
@@ -477,12 +479,28 @@ export const getActivitiesByFilters =
}
}
}
}
if
(
maximumDuration
&&
minimumDuration
)
{
query
.
filters
[
"$and"
]
=
[{
maximumDuration
:
{
$lte
:
maximumDuration
}
},
{
minimumDuration
:
{
$gte
:
minimumDuration
}
}];
// query.filters["$or"] = [{ maximumDuration: { $gte: maximumDuration } }, { minimumDuration: { $lte: minimumDuration } }];
delete
query
.
filters
.
maximumDuration
;
delete
query
.
filters
.
minimumDuration
;
}
if
(
!
(
maximumDuration
&&
minimumDuration
))
{
if
(
maximumDuration
)
{
if
(
maximumDuration
)
{
query
.
filters
[
"maximumDuration"
]
=
{
$lte
:
maximumDuration
};
query
.
filters
[
"maximumDuration"
]
=
{
$lte
:
maximumDuration
};
}
}
if
(
minimumDuration
)
{
if
(
minimumDuration
)
{
query
.
filters
[
"minimumDuration"
]
=
{
$gte
:
minimumDuration
};
query
.
filters
[
"minimumDuration"
]
=
{
$gte
:
minimumDuration
};
}
}
}
// if (maximumDuration) {
// query.filters["maximumDuration"] = { $gte: maximumDuration };
// }
// if (minimumDuration) {
// query.filters["minimumDuration"] = { $lte: minimumDuration };
// }
if
(
minGroupSize
)
{
if
(
minGroupSize
)
{
query
.
filters
[
"minGroupSize"
]
=
{
$gte
:
minGroupSize
};
query
.
filters
[
"minGroupSize"
]
=
{
$gte
:
minGroupSize
};
}
}
...
...
redux/actions/userActions.js
View file @
c45eea8
...
@@ -83,7 +83,7 @@ export const registerUser = userData => async dispatch => {
...
@@ -83,7 +83,7 @@ export const registerUser = userData => async dispatch => {
}
}
};
};
const
registerVendor
=
async
vendorData
=>
{
export
const
registerVendor
=
async
vendorData
=>
{
const
authUser
=
await
axios
.
post
(
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/auth/local`
,
{
const
authUser
=
await
axios
.
post
(
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/auth/local`
,
{
identifier
:
vendorData
.
email
,
identifier
:
vendorData
.
email
,
password
:
vendorData
.
password
password
:
vendorData
.
password
...
@@ -109,7 +109,7 @@ const registerVendor = async vendorData => {
...
@@ -109,7 +109,7 @@ const registerVendor = async vendorData => {
return
response
;
return
response
;
};
};
const
registerEndUser
=
async
vendorData
=>
{
export
const
registerEndUser
=
async
vendorData
=>
{
const
authUser
=
await
axios
.
post
(
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/auth/local`
,
{
const
authUser
=
await
axios
.
post
(
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/auth/local`
,
{
identifier
:
vendorData
.
email
,
identifier
:
vendorData
.
email
,
password
:
vendorData
.
password
password
:
vendorData
.
password
...
...
styles/globals.css
View file @
c45eea8
...
@@ -3956,6 +3956,9 @@ footer .footer-link ul {
...
@@ -3956,6 +3956,9 @@ footer .footer-link ul {
padding
:
0.5rem
0
;
padding
:
0.5rem
0
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.contact-numbe
.special-label
{
display
:
none
!important
;
}
@media
(
min-width
:
992px
)
{
@media
(
min-width
:
992px
)
{
.navbar-expand-lg
.navbar-nav
.nav-link
{
.navbar-expand-lg
.navbar-nav
.nav-link
{
margin
:
0
2rem
;
margin
:
0
2rem
;
...
...
yarn.lock
View file @
c45eea8
This diff is collapsed.
Click to expand it.
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment