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 b62606bb
authored
10 months ago
by
jaymehta
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
loading wishlist
1 parent
a08c5fbe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
components/detail/WIshlistComponent.js
pages/user/wishlist/index.js
redux/actions/activityAction.js
components/detail/WIshlistComponent.js
View file @
b62606b
...
...
@@ -4,11 +4,11 @@ import { useDispatch, useSelector } from "react-redux";
import
{
checkWishlist
,
deleteWishlist
,
getWishlists
,
toggleWishlist
}
from
"../../redux/actions/activityAction"
;
const
WishlistComponent
=
({
activityId
,
userId
})
=>
{
const
{
wishlists
}
=
useSelector
(
state
=>
state
.
wishlists
);
const
{
wishlists
,
loading
}
=
useSelector
(
state
=>
state
.
wishlists
);
const
[
isActive
,
setisActive
]
=
useState
(
false
);
const
[
wishlistId
,
setwishlistId
]
=
useState
();
const
dispatch
=
useDispatch
();
// console.log("wishlists", wishlists);
// console.log("wishlists", wishlists);
useEffect
(()
=>
{
wishlists
&&
wishlists
.
length
>
0
&&
...
...
This diff is collapsed.
Click to expand it.
pages/user/wishlist/index.js
View file @
b62606b
...
...
@@ -2,12 +2,19 @@ import React from "react";
import
Layout
from
"../../../components/layout/Layout"
;
import
MyWhishList
from
"../../../components/user/MyWhishList"
;
import
{
useSelector
}
from
"react-redux"
;
import
{
Skeleton
}
from
"antd"
;
export
default
function
UserProfilePage
()
{
const
{
wishlists
}
=
useSelector
(
state
=>
state
.
wishlists
)
const
{
wishlists
,
loading
}
=
useSelector
(
state
=>
state
.
wishlists
);
return
(
<
Layout
>
<
MyWhishList
data
=
{
wishlists
}
/
>
{
loading
?
(
<
div
>
<
Skeleton
active
/>
<
/div
>
)
:
(
<
MyWhishList
data
=
{
wishlists
}
/
>
)}
<
/Layout
>
);
};
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
redux/actions/activityAction.js
View file @
b62606b
...
...
@@ -530,7 +530,8 @@ export const getWishlists =
return
;
}
dispatch
({
type
:
GET_WISHLISTS_REQUEST
type
:
GET_WISHLISTS_REQUEST
,
loading
:
true
});
const
config
=
{
headers
:
{
...
...
@@ -557,7 +558,8 @@ export const getWishlists =
const
response
=
await
axios
.
get
(
`
${
process
.
env
.
NEXT_PUBLIC_BACKEND_API_URL
}
/api/wishlists?
${
queryString
}
`
,
config
);
dispatch
({
type
:
GET_WISHLISTS_SUCCESS
,
payload
:
response
.
data
.
data
payload
:
response
.
data
.
data
,
loading
:
false
});
return
response
.
data
.
data
;
...
...
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