Commit 1da2081c by Chetan

gift card and wishlist no data found and skeleton

1 parent 4e0139fe
...@@ -89,13 +89,13 @@ const GiftCard = () => { ...@@ -89,13 +89,13 @@ const GiftCard = () => {
<div className="col-md-7"> <div className="col-md-7">
{isStep1 && ( {isStep1 && (
<div className="gift-card-rt"> <div className="gift-card-rt">
<div className="back-btn"> {/* <div className="back-btn">
<a href=""> <a href="">
<span className="image-container"> <span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/arrow-left-02.svg" /> <Image layout="fill" alt="" className="image img-fluid" src="/images/icons/arrow-left-02.svg" />
</span> </span>
</a> </a>
</div> </div> */}
<Formik <Formik
initialValues={{ initialValues={{
customAmt: "", customAmt: "",
......
...@@ -25,8 +25,9 @@ const MyGiftCard = () => { ...@@ -25,8 +25,9 @@ const MyGiftCard = () => {
<div className="col-12 col-lg-12 form-container content-wraaper"> <div className="col-12 col-lg-12 form-container content-wraaper">
<h2 className="px-2 px-lg-0">My Gift Card</h2> <h2 className="px-2 px-lg-0">My Gift Card</h2>
<div className="row"> <div className="row">
{giftCard?.length > 0 && {giftCard?.length > 0 ?
giftCard.map((data, index) => ( <>
{giftCard.map((data, index) => (
<div className="col-12 col-lg-4 px-4 px-lg-3" key={`1${index}`}> <div className="col-12 col-lg-4 px-4 px-lg-3" key={`1${index}`}>
<div className="card-booking"> <div className="card-booking">
<div className="card-booking-img bgGrey"> <div className="card-booking-img bgGrey">
...@@ -53,7 +54,11 @@ const MyGiftCard = () => { ...@@ -53,7 +54,11 @@ const MyGiftCard = () => {
</div> </div>
</div> </div>
</div> </div>
))} ))}</>
:
<>
<p className="mb-5">No Item Found</p>
</>}
</div> </div>
</div> </div>
</div> </div>
......
import React from "react"; import React, { useEffect } from "react";
import Layout from "../../../components/layout/Layout"; import Layout from "../../../components/layout/Layout";
import MyGiftCard from "../../../components/user/MyGiftCard"; import MyGiftCard from "../../../components/user/MyGiftCard";
import { getGiftCard } from "../../../redux/actions/giftCardAction"; import { getGiftCard } from "../../../redux/actions/giftCardAction";
import { wrapper } from "../../../redux/store"; import { wrapper } from "../../../redux/store";
import { useDispatch } from "react-redux";
import { getCurrentEndUser } from "../../../redux/actions/userActions";
export default function UserGiftCardPage () { export default function UserGiftCardPage() {
const dispatch = useDispatch()
useEffect(() => {
dispatch(getCurrentEndUser())
}, [])
return ( return (
<Layout> <Layout>
...@@ -17,10 +23,10 @@ export default function UserGiftCardPage () { ...@@ -17,10 +23,10 @@ export default function UserGiftCardPage () {
export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => { export const getServerSideProps = wrapper.getServerSideProps(store => async ({ req, query }) => {
try { try {
// await store.dispatch(getGiftCard()) // await store.dispatch(getGiftCard())
return { return {
props: {}, props: {},
}; };
} catch (error) { } catch (error) {
} }
}); });
\ No newline at end of file \ No newline at end of file
...@@ -9,8 +9,19 @@ export default function UserProfilePage() { ...@@ -9,8 +9,19 @@ export default function UserProfilePage() {
return ( return (
<Layout> <Layout>
{loading ? ( {loading ? (
<div> <div className="container">
<Skeleton active /> <div className="py-5">
<div className="row">
{[1, 2, 3].map(() => (
<div className="col-lg-3 col-md-4 col-sm-12">
<div className="d-inline-flex flex-column">
<Skeleton.Button active style={{ height: 250, width: 290 }} />
<Skeleton.Button active style={{ marginTop: 10, width: 120 }} />
</div>
</div>
))}
</div>
</div>
</div> </div>
) : ( ) : (
<MyWhishList data={wishlists} /> <MyWhishList data={wishlists} />
......
...@@ -407,7 +407,7 @@ export const getCurrentEndUser = () => async dispatch => { ...@@ -407,7 +407,7 @@ export const getCurrentEndUser = () => async dispatch => {
if (!session) { if (!session) {
return; return;
} }
// console.log("session action", session); console.log("session action", session);
dispatch({ dispatch({
type: GET_END_USER_REQUEST type: GET_END_USER_REQUEST
}); });
...@@ -421,7 +421,7 @@ export const getCurrentEndUser = () => async dispatch => { ...@@ -421,7 +421,7 @@ export const getCurrentEndUser = () => async dispatch => {
const query = { const query = {
populate: ["user"], populate: ["user"],
filter: { filters: {
user: { user: {
id: { id: {
$eq: session.id $eq: session.id
...@@ -435,7 +435,7 @@ export const getCurrentEndUser = () => async dispatch => { ...@@ -435,7 +435,7 @@ export const getCurrentEndUser = () => async dispatch => {
}); });
console.log("querystring", query); console.log("querystring", query);
const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/end-users/?${queryString}`, config); const response = await axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/end-users/?${queryString}`, config);
console.log("response", response); console.log("response enduser", response);
dispatch({ dispatch({
type: GET_END_USER_SUCCESS, type: GET_END_USER_SUCCESS,
payload: response.data.data[0] payload: response.data.data[0]
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!