Commit a6321e4d by jaymehta
2 parents 6892cb29 27c80214
import { Fragment, useEffect, useState } from "react";
import { Button, Image } from "react-bootstrap";
import { getGiftCard } from "../../redux/actions/giftCardAction";
import { useDispatch, useSelector } from "react-redux";
import { Empty, Table } from "antd";
import { Dropdown, Menu, Space, Table, Tag } from "antd";
import axios from "axios";
import { DownCircleOutlined, MoreOutlined } from "@ant-design/icons";
import { getSession } from "next-auth/react";
import { toast } from "react-toastify";
const GiftcardListing = () => {
const [giftData, setGiftData] = useState([]);
useEffect(() => {
axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/gift-cards`).then((res) => {
let giftDatas =
res.data &&
res.data.data.map((data) => {
return {
key: data.id,
amount: data?.attributes?.amount,
senderEmail: data?.attributes?.senderEmail,
receiverEmail: data?.attributes?.receiverEmail,
status: data?.attributes?.status,
}
})
setGiftData(giftDatas)
}).catch((err) => {
console.log(err)
const [session, setSession] = useState()
const [update, setupdate] = useState(false)
useEffect(() => {
const fetchSession = async () => {
setSession(await getSession());
};
fetchSession();
// dispatch(getLoggedInVendor());
}, []);
const [giftData, setGiftData] = useState([]);
useEffect(() => {
axios.get(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/gift-cards`).then((res) => {
let giftDatas =
res.data &&
res.data.data.map((data) => {
return {
key: data.id,
amount: data?.attributes?.amount,
senderEmail: data?.attributes?.senderEmail,
receiverEmail: data?.attributes?.receiverEmail,
status: data?.attributes?.status,
}
})
}, [])
const columns = [
{
title: "Sender Email Address",
dataIndex: "senderEmail",
key: "senderEmail",
render: text => <a>{text}</a>
},
{
title: "Receiver Email Address",
dataIndex: "receiverEmail",
key: "receiverEmail",
render: text => <a>{text}</a>
},
{
title: "Amount",
dataIndex: "amount",
key: "amount",
render: text => <a>{text}</a>
},
{
title: "Status",
dataIndex: "status",
key: "status",
render: text => <a>{text}</a>
},
]
return (
<Fragment>
<div className="p-5 h-100">
<div className="d-flex align-items-center justify-content-between px-2 mb-2">
<div>
<h2 style={{ fontSize: 28 }}>Gift Card Requests</h2>
<p>View all the gift cards</p>
</div>
<div>
<Button type="button" variant="" className="btnAdd m-0">
<Image alt="" width="16" height="16" src="/images/vendor/icon-filter.svg" className="me-2" /> Filter
</Button>
</div>
</div>
<Table columns={columns} dataSource={giftData} />
</div>
</Fragment>
);
setGiftData(giftDatas)
}).catch((err) => {
console.log(err)
})
}, [update])
const changeStatusFn = async ({ id, data }) => {
const config = {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${session.jwt}`
}
}
const giftdata = {
data
}
const response = await axios.put(`${process.env.NEXT_PUBLIC_BACKEND_API_URL}/api/gift-cards/${id}`, giftdata, config)
if (response.status == 200) {
toast.success("Status changed")
setupdate(!update)
}
console.log("response gift card", response);
}
const columns = [
{
title: "Sender Email Address",
dataIndex: "senderEmail",
key: "senderEmail",
render: text => <a>{text}</a>
},
{
title: "Receiver Email Address",
dataIndex: "receiverEmail",
key: "receiverEmail",
render: text => <a>{text}</a>
},
{
title: "Amount",
dataIndex: "amount",
key: "amount",
render: text => <a>{text}</a>
},
{
title: "Status",
dataIndex: "status",
key: "status",
render: tag => (
<span>
{tag == "rejected" ? (
<Tag color={"red"} key={tag}>
{tag.toUpperCase()}
</Tag>
) : (
<Tag color={"blue"} key={tag}>
{tag === "fulfilled" ? "APPROVED" : tag.toUpperCase()}
</Tag>
)}
</span>
)
},
{
title: 'Actions',
width: 100,
dataIndex: 'key',
key: 'key',
render: (_, record) => (
<Space size="middle">
{/* <a>Invite {record.name}</a> */}
<Dropdown
menu={{
items: [
{
key: "1",
label: (
<a
rel="noopener noreferrer"
onClick={async () => {
console.log("record", record);
await changeStatusFn({ id: record.key, data: { status: "fulfilled" } })
// setrejectionId(record.key);
// adminActions({ type: "reject", activityId: record.key });
}}
>
Approve
</a>
)
},
{
key: "2",
label: (
<a
target="_blank"
rel="noopener noreferrer"
onClick={async () => {
console.log("record", record);
await changeStatusFn({ id: record.key, data: { status: "rejected" } })
// setrejectionId(record.key);
// adminActions({ type: "reject", activityId: record.key });
}}
>
Reject
</a>
)
}
]
}}
placement="bottomLeft"
trigger={['click']}
>
<button className="btn border-0">
<DownCircleOutlined style={{ fontSize: "20px", color: "#08c" }} onClick={() => { }} />
</button>
</Dropdown>
</Space>
)
}
]
return (
<Fragment>
<div className="p-5 h-100">
<div className="d-flex align-items-center justify-content-between px-2 mb-2">
<div>
<h2 style={{ fontSize: 28 }}>Gift Card Requests</h2>
<p>View all the gift cards</p>
</div>
<div>
<Button type="button" variant="" className="btnAdd m-0">
<Image alt="" width="16" height="16" src="/images/vendor/icon-filter.svg" className="me-2" /> Filter
</Button>
</div>
</div>
<Table columns={columns} dataSource={giftData} />
</div>
</Fragment>
);
};
export default GiftcardListing;
......@@ -10,47 +10,47 @@ export const BlogData = [
title: "13 MOST Unique Places to Stay in Washington State",
discription: "Undoubtedly, the most unique places to stay........",
read: "10-15 Read",
flag:"Adventure"
flag: "Adventure"
},
{
image: "/images/blogs/02.png",
title: "13 MOST Unique Places to Stay in Washington State",
discription: "Undoubtedly, the most unique places to stay........",
read: "10-15 Read",
flag:"Adventure"
flag: "Adventure"
},
{
image: "/images/blogs/03.png",
title: "13 MOST Unique Places to Stay in Washington State",
discription: "Undoubtedly, the most unique places to stay........",
read: "10-15 Read",
flag:"Art & History"
flag: "Art & History"
},
{
image: "/images/blogs/01.png",
title: "13 MOST Unique Places to Stay in Washington State",
discription: "Undoubtedly, the most unique places to stay........",
read: "10-15 Read",
flag:"Adventure"
flag: "Adventure"
},
{
image: "/images/blogs/02.png",
title: "13 MOST Unique Places to Stay in Washington State",
discription: "Undoubtedly, the most unique places to stay........",
read: "10-15 Read",
flag:"Adventure"
flag: "Adventure"
},
{
image: "/images/blogs/03.png",
title: "13 MOST Unique Places to Stay in Washington State",
discription: "Undoubtedly, the most unique places to stay........",
read: "10-15 Read",
flag:"Art & History"
flag: "Art & History"
}
];
const BlogsItem = ({blogs}) => {
const [showContent, setShowContent] = useState(false);
const BlogsItem = ({ blogs }) => {
const [showContent, setShowContent] = useState(false);
const [isGridViewOpen, setIsGridViewOpen] = useState(false);
const [isOpen, setIsOpen] = useState(false);
const toggleContent = () => {
......@@ -99,9 +99,9 @@ const BlogsItem = ({blogs}) => {
</div>
</div>
<div className="listing-filter">
<div className="box-01">
<div className="inner">
<Accordion className="accordion-filter" defaultActiveKey="0" flush>
<Accordion.Item eventKey="0">
......@@ -290,7 +290,7 @@ const BlogsItem = ({blogs}) => {
<div></div>
</div>
<div className="text-center">
<Button variant="primary">Submit</Button>
<Button variant="primary">Submit</Button>
</div>
</div>
</div>
......
......@@ -33,7 +33,7 @@ const Detail = () => {
<main>
<section className="main-mt">
<div className="container mt-3">
<div className="py-5">
<div className="py-4 py-lg-5 breadcrumb-wrap">
<ConfigProvider
theme={{
components: {
......
......@@ -143,15 +143,13 @@ const DetailInfo = ({ activityById }) => {
router.push("/gift-card");
}
}}
variant="secondary"
variant="secondary me-3"
>
Gift Now
<span className="image-container btn-gift">
<Image layout="fill" className="image img-fluid" src="/images/icons/gift-card-icon.svg" />
</span>
</Button>
</div>
<div>
<Button
disabled={loading}
// onClick={() => {
......@@ -161,11 +159,12 @@ const DetailInfo = ({ activityById }) => {
// setenquiryModal(true);
// }
// }}
variant="primary me-3"
variant="primary"
>
Book Now
Book Now
</Button>
</div>
</div>
</div>
)}
......
......@@ -36,7 +36,7 @@ const DetailSchedule = ({ activityById }) => {
return array;
};
return (
<div className="row mb-5">
<div className="row mb-3 mb-lg-4">
{activityById && (
<div className="col-12">
<ul className="availability-wrappper">
......
......@@ -108,20 +108,20 @@ const SimilarExperiences = ({ allActivitiesData }) => {
<div className="browse-experiences-item">
<div className="img-wrapper">
<span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src={data.image} />
<Image layout="fill" alt="" className="image img-fluid" src={data.image} priority />
</span>
<div className="top-rated">{data.topRated}</div>
{/* <div className="top-rated">{data.topRated}</div> */}
</div>
<div className="info">
<div className="top-name">
<div className="title">{data.title}</div>
<div className="rating-wishlist">
<div className="rating">
{/* <div className="rating">
<span className="number">8.8</span>
<span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/star.svg" />
</span>
</div>
</div> */}
{endUser && <WishlistComponent userId={endUser.id} activityId={data.id} />}
{/* <div className="wishlist">
<span className="image-container">
......@@ -132,16 +132,17 @@ const SimilarExperiences = ({ allActivitiesData }) => {
</div>
<div className="discription">
{data.discription}{" "}
<a
{/* <a
onClick={() => {
router.push(`/activities/${data.id}`);
}}
>
Read More
</a>
</a> */}
</div>
<div className="price">
${data.price} <span className="off">{data.offPrice} OFF</span>
${data.price}
{/* <span className="off">{data.offPrice} OFF</span> */}
</div>
<div className="detail">
<div className="">{data.days}</div>
......
......@@ -13,7 +13,7 @@ const WishlistComponent = ({ activityId, userId }) => {
wishlists &&
wishlists.length > 0 &&
wishlists.map(item => {
if (item.attributes.experience.data.id == activityId) {
if (item?.attributes?.experience?.data?.id == activityId) {
setisActive(true);
setwishlistId(item.id);
}
......
......@@ -72,12 +72,12 @@ const ProductItem = () => {
<div className="top-name">
<div className="title">{data.title}</div>
<div className="rating-wishlist">
<div className="rating">
{/* <div className="rating">
<span className="number">8.8</span>
<span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/star.svg" />
</span>
</div>
</div> */}
<div className="wishlist">
<span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/wishlist.svg" />
......@@ -85,11 +85,12 @@ const ProductItem = () => {
</div>
</div>
</div>
<div className="discription">
{/* <div className="discription">
{data.discription} <a href="">Read More</a>
</div>
</div> */}
<div className="price">
${data.price} <span className="off">{data.offPrice} OFF</span>
${data.price}
{/* <span className="off">{data.offPrice} OFF</span> */}
</div>
<div className="detail">
<div className="">{data.days}</div>
......
......@@ -3,6 +3,7 @@ import Image from "next/image"
import { useRouter } from "next/router";
import { signOut } from "next-auth/react";
import { UserOutlined } from '@ant-design/icons';
import { ToastContainer } from "react-toastify";
export const GenericHeader = ({ venderBusiness, venderEmail, businessLogo, adminName, adminEmail, isRoute }) => {
const router = useRouter();
const VenderDetails = () => {
......@@ -14,7 +15,7 @@ export const GenericHeader = ({ venderBusiness, venderEmail, businessLogo, admin
</div>
:
<div className="d-flex align-items-center gap-3">
<Image src={businessLogo} height={50} width={70} objectFit="contain"/>
<Image src={businessLogo} height={50} width={70} objectFit="contain" />
<div className="d-flex flex-column">
<p className="m-0">{venderBusiness}</p>
<p className="m-0">{venderEmail}</p>
......@@ -51,6 +52,7 @@ export const GenericHeader = ({ venderBusiness, venderEmail, businessLogo, admin
'-moz-box-shadow': '0px 4px 1px -3px rgba(0,0,0,0.56)'
}}
>
<Image loading="lazy" objectFit="contain" height={50} width={100} alt="" className="" src="/images/main-logo.svg" />
<div className="d-flex align-items-center gap-5">
{isRoute === 'vendor' && <VenderDetails />}
......
......@@ -6,7 +6,7 @@ import { GenericHeader } from "./GenericHeader";
import { GenericSidebar } from "./GenericSidebar";
import { getActivitiesForAdmin } from "../../../redux/actions/activityAction";
import { useRouter } from "next/router";
import { ToastContainer } from "react-bootstrap";
import { ToastContainer } from "react-toastify";
export const GenericLayout = ({ children }) => {
const dispatch = useDispatch();
......
......@@ -56,7 +56,7 @@ const Header = () => {
</Navbar.Brand>
<Navbar.Toggle aria-controls="navbarScroll" />
<Navbar.Collapse id="navbarScroll">
<Nav className=" my-2 my-lg-0" style={{ maxHeight: "100px" }} navbarScroll>
<Nav className=" my-2 my-lg-0" navbarScroll>
<ActiveLink href="/user/wishlist" activeClassName="active">
<a className="nav-link ">Wishlist</a>
</ActiveLink>
......
......@@ -67,7 +67,7 @@ console.log("queryParams", queryParams);
<span className="image-container">
<img layout="fill" alt="" className="image img-fluid" src={cleanImage(data.attributes?.image?.data?.attributes)} />
</span>
<div className="top-rated">Top Rated</div>
{/* <div className="top-rated">Top Rated</div> */}
</div>
<div className="info">
<div className="top-name">
......@@ -92,7 +92,7 @@ console.log("queryParams", queryParams);
</span>
</div>
<div className="detail">
<div className="">For 1 Night</div>
{/* <div className="">For 1 Night</div> */}
<div className="">Includes taxes & Fees</div>
</div>
<div className="explore-now">
......
......@@ -31,18 +31,18 @@ const MyWhishList = ({ data }) => {
<span className="image-container">
<Image src={cleanImage(data?.attributes?.experience?.data?.attributes?.image?.data?.attributes)} layout="fill" className="image img-fluid" />
</span>
<div className="top-rated">Top Rated</div>
{/* <div className="top-rated">Top Rated</div> */}
</div>
<div className="info">
<div className="top-name">
<div className="title">{data?.attributes?.experience?.data?.attributes?.name}</div>
<div className="rating-wishlist">
<div className="rating">
{/* <div className="rating">
<span className="number">{data?.attributes?.experience?.data?.attributes?.rating}</span>
<span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/star.svg" />
</span>
</div>
</div> */}
<WishlistComponent activityId={data?.attributes?.experience?.data?.id} userId={data?.attributes?.endUser?.data?.id} />
</div>
</div>
......@@ -50,10 +50,11 @@ const MyWhishList = ({ data }) => {
<p className="text-trunc-2">{data?.attributes?.experience?.data?.attributes?.description}</p>
</div>
<div className="price">
${data?.attributes?.experience?.data?.attributes?.pricePerPerson} <span className="off">{}% OFF</span>
${data?.attributes?.experience?.data?.attributes?.pricePerPerson}
{/* <span className="off">{}% OFF</span> */}
</div>
<div className="detail">
<div className="">For 1 Night</div>
{/* <div className="">For 1 Night</div> */}
<div className="">Includes taxes & Fees</div>
</div>
<div className="explore-now">
......
No preview for this file type
......@@ -31,7 +31,7 @@ acronym,
address,
big,
cite,
code,
55 code,
del,
dfn,
em,
......@@ -1959,7 +1959,7 @@ span.form-error,
}
.similar-experiences-session {
padding: 2rem 0;
padding: 1rem 0;
}
.browse-experiences-item {
......@@ -2082,7 +2082,7 @@ span.form-error,
margin-bottom: 10px;
}
.browse-experiences-item .info .discription > span {
.browse-experiences-item .info .discription {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
......@@ -2750,13 +2750,14 @@ button:focus:not(:focus-visible) {
align-items: center;
flex-wrap: wrap;
margin-top: 2rem;
padding-left: 0;
}
.availability-wrappper li {
width: 32%;
width: 31%;
display: flex;
align-items: center;
margin: 0.5rem;
margin: 0.5rem 1rem 0.5rem 0.5rem;
}
.availability-wrappper li > span {
......@@ -2805,7 +2806,7 @@ button:focus:not(:focus-visible) {
}
.guest-reviews-detail .head .name {
font-size: 24px;
font-size: calc(20px + (24 - 20) * (100vw - 320px) / (1920 - 320));
line-height: 24px;
}
......@@ -2941,7 +2942,7 @@ button:focus:not(:focus-visible) {
}
.faqs-session {
padding: 5rem 0;
padding: 4rem 0;
}
.subscribe label .btn {
......@@ -3899,6 +3900,7 @@ img:hover {
align-items: center;
justify-content: flex-end;
margin-bottom: 4rem;
margin-top: 1.5rem;
}
.load-more .pagination .page-item {
......@@ -3933,6 +3935,19 @@ img:hover {
.listing-wrapper .product-info {
padding-left: 2rem;
}
.breadcrumb-wrap .ant-breadcrumb ol li.ant-breadcrumb-separator {
margin: 0 0.8rem;
}
.breadcrumb-wrap .ant-breadcrumb ol li .ant-breadcrumb-link {
font-size: calc(14px + (14 - 14) * (100vw - 320px) / (1920 - 320));
}
.most-read-blogs-session,
.blogs-session {
padding-bottom: 3rem;
}
footer .footer-link ul {
padding-left: 0;
}
@media (min-width: 992px) {
.navbar-expand-lg .navbar-nav .nav-link {
margin: 0 2rem;
......@@ -4115,6 +4130,17 @@ img:hover {
}
@media (max-width: 767px) {
.product-info .btn-row .btn {
padding-left: 5vw;
padding-right: 5vw;
}
.load-more {
justify-content: center;
}
.btn-primary,
.vendor-signup a {
padding: 0.6rem 2rem;
}
.browse-experiences-item .img-wrapper .image-container .image {
height: 220px !important;
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!