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 eeb7fcd7
authored
2024-05-10 11:06:29 +0530
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
enquire btn loading
1 parent
e4cb6e02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
components/detail/DetailInfo.js
components/detail/DetailInfo.js
View file @
eeb7fcd
...
...
@@ -10,6 +10,7 @@ import { sendEnquiry } from "../../redux/actions/enquiryAction.js";
import
{
useDispatch
,
useSelector
}
from
"react-redux"
;
import
{
toast
}
from
"react-toastify"
;
import
{
getCurrentEndUser
}
from
"../../redux/actions/userActions.js"
;
import
{
Loader
}
from
"react-bootstrap-typeahead"
;
const
DetailInfo
=
({
activityById
})
=>
{
const
dispatch
=
useDispatch
();
...
...
@@ -19,6 +20,7 @@ const DetailInfo = ({ activityById }) => {
// const [session, setSession] = useState(null);
const
[
enqDate
,
setenqDate
]
=
useState
();
const
[
loading
,
setloading
]
=
useState
(
false
);
const
{
loadedUser
}
=
useSelector
(
state
=>
state
.
loadedUser
);
const
{
endUser
}
=
useSelector
(
state
=>
state
.
endUser
);
// useEffect(() => {
...
...
@@ -110,15 +112,18 @@ const DetailInfo = ({ activityById }) => {
<
div
className
=
""
>
{
activityById
.
data
.
attributes
.
address
}
<
/div
>
<
div
className
=
"btn-row"
>
<
Button
disabled
=
{
loading
}
onClick
=
{
async
()
=>
{
setloading
(
true
);
console
.
log
(
"hello"
);
let
res
=
await
sendEnquiry
({
activityId
:
activityById
.
data
.
id
,
userId
:
endUser
.
id
,
vendorId
:
activityById
.
data
.
attributes
.
vendor
.
data
.
id
});
console
.
log
(
"res"
,
res
);
toast
.
success
(
"Enquiry sent successfully, our team will get back to you shortly! Thank you!"
);
setloading
(
false
);
}}
variant
=
"primary me-3"
>
Enquire
Now
{
loading
?
<
Loader
/>
:
"Enquire Now"
}
<
/Button
>
<
Button
variant
=
"secondary"
>
Gift
Now
{
" "
}
...
...
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