Detail.js
2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import React, { Fragment, useEffect, useState } from "react";
import DetailGallery from "./DetailGallery";
import DetailInfo from "./DetailInfo";
import { Breadcrumb } from "react-bootstrap";
import GuestReviews from "./GuestReviews";
import SimilarExperiences from "./SimilarExperiences";
import Faqs from "./Faqs";
import SignUpToExperienceOurPlatform from "../home/SignUpToExperienceOurPlatform";
import { useDispatch, useSelector } from "react-redux";
import { getActivitiesByFilters } from "../../redux/actions/activityAction";
import { useRouter } from "next/router";
import Image from "next/image";
import DetailSchedule from "./DetailSchedule";
const Detail = () => {
const router = useRouter();
const dispatch = useDispatch();
const { allActivitiesData } = useSelector(state => state.allActivitiesData);
const { activityById } = useSelector(state => state.activityById);
const { loadedUser } = useSelector(state => state.loadedUser);
const { faqs } = useSelector(state => state.faqs);
useEffect(() => {
// console.log("router", activityById.data.attributes.category?.data?.attributes.name);
dispatch(getActivitiesByFilters({ category: activityById?.data.attributes.category?.data?.id, currentPage: router.query.page }));
}, [activityById, router]);
// console.log("faqs=>", faqs);
console.log("activityById", activityById);
console.log("loadedUser", loadedUser);
return (
<Fragment>
<main>
<section className="main-mt">
<div className="container mt-5">
<div className="row hide-on-mobile">
<div className="col-12">
<div className="breadcrum$eq: categoryb-container">
{/* <Breadcrumb>
<Breadcrumb.Item href="#">Home</Breadcrumb.Item>
<Breadcrumb.Item href="#">New York</Breadcrumb.Item>
<Breadcrumb.Item href="#">Adventure</Breadcrumb.Item>
<Breadcrumb.Item active>Mountain Climbing</Breadcrumb.Item>
</Breadcrumb> */}
</div>
</div>
</div>
<div className="row">
<div className="col-xl-5">
<DetailGallery activityById={activityById}></DetailGallery>
</div>
<div className="col-xl-7 listing-wrapper">
<DetailInfo activityById={activityById}></DetailInfo>
</div>
</div>
<DetailSchedule activityById={activityById} />
</div>
</section>
<GuestReviews activityById={activityById} />
<SimilarExperiences allActivitiesData={allActivitiesData} />
<Faqs faqs={faqs} />
<SignUpToExperienceOurPlatform />
</main>
</Fragment>
);
};
export default Detail;