Commit 1da2081c by Chetan

gift card and wishlist no data found and skeleton

1 parent 4e0139fe
......@@ -89,13 +89,13 @@ const GiftCard = () => {
<div className="col-md-7">
{isStep1 && (
<div className="gift-card-rt">
<div className="back-btn">
{/* <div className="back-btn">
<a href="">
<span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/arrow-left-02.svg" />
</span>
</a>
</div>
</div> */}
<Formik
initialValues={{
customAmt: "",
......
......@@ -25,8 +25,9 @@ const MyGiftCard = () => {
<div className="col-12 col-lg-12 form-container content-wraaper">
<h2 className="px-2 px-lg-0">My Gift Card</h2>
<div className="row">
{giftCard?.length > 0 &&
giftCard.map((data, index) => (
{giftCard?.length > 0 ?
<>
{giftCard.map((data, index) => (
<div className="col-12 col-lg-4 px-4 px-lg-3" key={`1${index}`}>
<div className="card-booking">
<div className="card-booking-img bgGrey">
......@@ -53,7 +54,11 @@ const MyGiftCard = () => {
</div>
</div>
</div>
))}
))}</>
:
<>
<p className="mb-5">No Item Found</p>
</>}
</div>
</div>
</div>
......
......@@ -4,15 +4,21 @@ import { Button } from "react-bootstrap";
import { cleanImage } from "../../services/imageHandling";
import WishlistComponent from "../detail/WIshlistComponent";
import { useRouter } from "next/router";
import { useSelector } from "react-redux";
const MyWhishList = ({ data }) => {
const router = useRouter();
const { endUser } = useSelector(state => state.endUser)
console.log("checking end user", endUser);
return (
<Fragment>
<div className="container pb-5">
<div className="row">
<div className="col-12 col-lg-12 form-container content-wraaper">
<h2 className="px-2 px-lg-0">My Bookings</h2>
{endUser === null || endUser === undefined || endUser === "" ?
<h1>You need to login first!</h1>
:
<div className="listing-items">
<div className="row">
{data?.length > 0 ?
......@@ -68,10 +74,10 @@ const MyWhishList = ({ data }) => {
<>
<p>No Item Found</p>
</>
}
</div>
</div>
}
</div>
</div>
</div>
......
import React from "react";
import React, { useEffect } from "react";
import Layout from "../../../components/layout/Layout";
import MyGiftCard from "../../../components/user/MyGiftCard";
import { getGiftCard } from "../../../redux/actions/giftCardAction";
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 (
<Layout>
......
......@@ -9,8 +9,19 @@ export default function UserProfilePage() {
return (
<Layout>
{loading ? (
<div>
<Skeleton active />
<div className="container">
<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>
) : (
<MyWhishList data={wishlists} />
......
......@@ -407,7 +407,7 @@ export const getCurrentEndUser = () => async dispatch => {
if (!session) {
return;
}
// console.log("session action", session);
console.log("session action", session);
dispatch({
type: GET_END_USER_REQUEST
});
......@@ -421,7 +421,7 @@ export const getCurrentEndUser = () => async dispatch => {
const query = {
populate: ["user"],
filter: {
filters: {
user: {
id: {
$eq: session.id
......@@ -435,7 +435,7 @@ export const getCurrentEndUser = () => async dispatch => {
});
console.log("querystring", query);
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({
type: GET_END_USER_SUCCESS,
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!