Commit 98208f30 by jaymehta

changes

1 parent b4912241
......@@ -109,7 +109,7 @@ const BrowseExperiences = ({ allActivitiesData }) => {
</div>
</div>
<div className="discription">
<span>{data?.attributes?.description}</span>
<span>{data?.attributes?.description.slice(0, 80)}...</span>
{/* <a href="/detail">Read More</a> */}
</div>
<div className="price">
......
......@@ -6,7 +6,7 @@ import { toast } from "react-toastify";
import Link from "next/link";
const Footer = () => {
const [email, setEmail] = useState('');
const [email, setEmail] = useState("");
const [isValidEmail, setIsValidEmail] = useState(true);
const validateEmail = () => {
......@@ -15,14 +15,14 @@ const Footer = () => {
return regex.test(email);
};
const handleSubmit = async (e) => {
const handleSubmit = async e => {
e.preventDefault();
if (validateEmail()) {
// Email is valid, perform your action (e.g., subscribe)
const res = await newsletter(email);
console.log("res", res.data);
// Reset email input field after successful submission
setEmail('');
setEmail("");
setIsValidEmail(true);
toast.success("Subscribed successful!");
} else {
......@@ -68,22 +68,14 @@ const Footer = () => {
<h3>QUICK LINKS</h3>
<ul>
<li>
<Link prefetch href="/about-us">About Us</Link>
<Link prefetch href="/about-us">
About Us
</Link>
</li>
<li>
<Link prefetch href="/contact-us">Contact Us</Link>
</li>
<li>
<Link prefetch href="">Corporate Programs</Link>
</li>
<li>
<Link prefetch href="">Private Events</Link>
</li>
<li>
<Link prefetch href="">Promo T & Cs</Link>
</li>
<li>
<Link prefetch href="">Gifting</Link>
<Link prefetch href="/contact-us">
Contact Us
</Link>
</li>
</ul>
</div>
......@@ -122,17 +114,25 @@ const Footer = () => {
<h3>HELP</h3>
<ul>
<li>
<Link prefetch href="/terms-and-conditions">Terms & Policy</Link>
<Link prefetch href="/terms-and-conditions">
Terms & Policy
</Link>
</li>
<li>
<Link prefetch href="/privacy-policy">Privacy Policy</Link>
<Link prefetch href="/privacy-policy">
Privacy Policy
</Link>
</li>
<li>
<Link prefetch href="">Careers</Link>
{/* <li>
<Link prefetch href="">
Careers
</Link>
</li>
<li>
<Link prefetch href="">FAQs</Link>
</li>
<Link prefetch href="">
FAQs
</Link>
</li> */}
</ul>
</div>
</div>
......@@ -176,17 +176,14 @@ const Footer = () => {
/>
<label htmlFor="subscribe">
<Button variable="primary" type="submit">Subscribe </Button>
<Button variable="primary" type="submit">
Subscribe{" "}
</Button>
</label>
</div>
</div>
<div className="row">
<div className="col-12">
{!isValidEmail && (
<div style={{ color: 'red' }}>Please enter a valid email address.</div>
)}
</div>
<div className="col-12">{!isValidEmail && <div style={{ color: "red" }}>Please enter a valid email address.</div>}</div>
</div>
</form>
</div>
......
......@@ -92,7 +92,7 @@ const Header = () => {
console.log("selected", selected);
// router.push("/listing");
if (selected[0]?.label.includes("Experience")) {
console.log("jjja");
// console.log("jjja");
router.push(`/activities/${selected[0].id}`);
}
if (selected[0]?.label.includes("Category")) {
......
......@@ -20,7 +20,7 @@ const LetDiscover = ({ categories }) => {
const { activityFilters } = useSelector(sate => sate.activityFilters);
const router = useRouter();
const dispatch = useDispatch();
const [activeIndex, setActiveIndex] = useState(null);
const [activeIndex, setActiveIndex] = useState("All");
// const [loading, setloading] = useState(null);
console.log("categories", categories);
console.log("subCategories", subCategories);
......
......@@ -13,7 +13,7 @@ const Listing = () => {
const { categories } = useSelector(sate => sate.categories);
const { subCategories } = useSelector(sate => sate.subCategories);
console.log("allActivitiesData >>>> 123", allActivitiesData);
console.log("allActivitiesData >>>>", allActivitiesData);
return (
<Fragment>
......
......@@ -9,11 +9,14 @@ import { cleanImage } from "../../services/imageHandling";
import WishlistComponent from "../detail/WIshlistComponent";
import Pagination from "react-js-pagination";
import { getActivitiesByFilters } from "../../redux/actions/activityAction";
import Link from "next/link";
const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) => {
// const [gridClass, setGridClass] = useState('col-md-3');
const { endUser } = useSelector(state => state.endUser);
const router = useRouter();
const [readMoreText, setreadMoreText] = useState();
const [showModal, setshowModal] = useState(false);
const dispatch = useDispatch();
// useEffect(() => {
// dispatch(getActivitiesByFilters({ currentPage: router.query.page }));
......@@ -39,18 +42,28 @@ const ListingItems = ({ allActivitiesData, loading, gridClass, totalCount }) =>
} else {
queryParams.append("page", pageNumber);
}
console.log("queryParams", queryParams);
// router.push(`/listing?page=${pageNumber}`)
// router.push({
// query: `/listing?page=${pageNumber}`
// });
console.log("queryParams", queryParams);
// router.push(`/listing?page=${pageNumber}`)
// router.push({
// query: `/listing?page=${pageNumber}`
// });
dispatch(getActivitiesByFilters({ currentPage: pageNumber }));
};
console.log("page", page);
useEffect(() => {
dispatch(getActivitiesByFilters({ currentPage: page }));
}, [])
}, []);
const calculateRating = data => {
let value = 0
data.map(item => {
// console.log("item", item);
value = value + item.attributes.rating;
});
// console.log("value", value);
let length = data.length;
return Math.floor(value / length);
};
return (
<>
{allActivitiesData && !allActivitiesData.data.length == 0 ? (
......@@ -67,27 +80,39 @@ 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> */}
{data.attributes.rating > 100 && <div className="top-rated">Top Rated</div>}
</div>
<div className="info">
<div className="top-name">
<Link href={`/activities/${data.id}`}>
<div className="title">{data?.attributes?.name}</div>
</Link>
<div className="rating-wishlist">
<div className="rating">
<span className="number">{data?.attributes?.rating}</span>
{data?.attributes?.reviews.data.length > 0 && <div className="rating">
{/* {console.log(">>", calculateRating(data?.attributes?.reviews.data))} */}
{<span className="number">{calculateRating(data?.attributes?.reviews.data)}</span>}
<span className="image-container">
<Image layout="fill" alt="" className="image img-fluid" src="/images/icons/star.svg" />
</span>
</div>
</div>}
{endUser && <WishlistComponent activityId={data.id} userId={endUser.id} />}
</div>
</div>
<div className="discription">
{data.discription}
{/* <a href="">Read More</a> */}
{data?.attributes.description.slice(0, 70)}
<a
onClick={() => {
// setreadMoreText(data);
// setshowModal(true);
}}
>
Read More
</a>
</div>
<div className="price">
${data?.attributes?.pricePerPerson} <span className="off">{data?.attributes?.off}
${data?.attributes?.pricePerPerson}{" "}
<span className="off">
{data?.attributes?.off}
{/* % OFF */}
</span>
</div>
......
......@@ -442,7 +442,8 @@ export const getActivitiesByFilters =
"category",
"reviews",
"termsConditions",
"cancellationPolicy"
"cancellationPolicy",
"reviews"
]
// sort: ["pricePerPerson:asc"]
};
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!