stay_commerce-frontend 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +8 -0
- data/app/assets/builds/404error-RVKQJ4S4.digested.jpg +0 -0
- data/app/assets/builds/Facebook-5HJUILVR.digested.svg +3 -0
- data/app/assets/builds/Google-CZ3UPVSC.digested.svg +6 -0
- data/app/assets/builds/application.js +95 -0
- data/app/assets/builds/application.js.map +7 -0
- data/app/assets/builds/beach-KAZW5GM3.digested.jpg +0 -0
- data/app/assets/builds/beach2-3ARC34NS.digested.jpg +0 -0
- data/app/assets/builds/beach3-PSTOH5FV.digested.jpg +0 -0
- data/app/assets/builds/beach4-PWNRPD3S.digested.jpg +0 -0
- data/app/assets/builds/beach5-SBOKKRHF.digested.jpg +0 -0
- data/app/assets/builds/beach6-SXZ5Y5AI.digested.jpg +0 -0
- data/app/assets/builds/beach7-FNBMFVKK.digested.jpg +0 -0
- data/app/assets/builds/beach8-TD7LTRQM.digested.jpg +0 -0
- data/app/assets/builds/bg-image-H7UGUMV2.digested.jpg +0 -0
- data/app/assets/builds/bgimage-DU3PCXKN.digested.jpg +0 -0
- data/app/assets/builds/bundle.css +30914 -0
- data/app/assets/builds/bundle.css.map +7 -0
- data/app/assets/builds/bundle.js +74569 -0
- data/app/assets/builds/bundle.js.map +7 -0
- data/app/assets/builds/hotel1-HGBXPKJK.digested.jpg +0 -0
- data/app/assets/builds/logo_updated-KQWAXLYL.digested.png +0 -0
- data/app/assets/builds/styles.css +6422 -0
- data/app/assets/builds/styles.css.map +7 -0
- data/app/assets/config/manifest.js +2 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/stay_commerce/frontend/beach-666122_1280 (1).jpg +0 -0
- data/app/assets/images/stay_commerce/frontend/beach-666122_1280.jpg +0 -0
- data/app/assets/stylesheets/stay_commerce/frontend/application.css +15 -0
- data/app/controllers/stay_commerce/frontend/application_controller.rb +8 -0
- data/app/controllers/stay_commerce/frontend/welcome_controller.rb +6 -0
- data/app/helpers/stay_commerce/frontend/application_helper.rb +6 -0
- data/app/javascript/Images/404error.jpg +0 -0
- data/app/javascript/Images/Facebook.svg +3 -0
- data/app/javascript/Images/Google.svg +6 -0
- data/app/javascript/Images/beach-2245867_1280.jpg +0 -0
- data/app/javascript/Images/beach.jpg +0 -0
- data/app/javascript/Images/beach2.jpg +0 -0
- data/app/javascript/Images/beach3.jpg +0 -0
- data/app/javascript/Images/beach4.jpg +0 -0
- data/app/javascript/Images/beach5.jpg +0 -0
- data/app/javascript/Images/beach6.jpg +0 -0
- data/app/javascript/Images/beach7.jpg +0 -0
- data/app/javascript/Images/beach8.jpg +0 -0
- data/app/javascript/Images/bg-image.jpg +0 -0
- data/app/javascript/Images/bgimage.jpg +0 -0
- data/app/javascript/Images/blog-1.jpg +0 -0
- data/app/javascript/Images/gallery.png +0 -0
- data/app/javascript/Images/home 5.jpg +0 -0
- data/app/javascript/Images/home1.jpg +0 -0
- data/app/javascript/Images/home2.jpg +0 -0
- data/app/javascript/Images/home3.jpg +0 -0
- data/app/javascript/Images/home6.jpg +0 -0
- data/app/javascript/Images/hotel1.jpg +0 -0
- data/app/javascript/Images/room1.jpg +0 -0
- data/app/javascript/Images/room2.jpg +0 -0
- data/app/javascript/Images/room3.jpg +0 -0
- data/app/javascript/Images/room4.jpg +0 -0
- data/app/javascript/Images/wine-4520213_1280.jpg +0 -0
- data/app/javascript/application.js +1 -0
- data/app/javascript/react/Api/apiConstants.js +47 -0
- data/app/javascript/react/assets/beach-2245867_1280.jpg +0 -0
- data/app/javascript/react/assets/logo.png +0 -0
- data/app/javascript/react/assets/logo_updated.png +0 -0
- data/app/javascript/react/components/AboutUsPage/AboutPage.jsx +41 -0
- data/app/javascript/react/components/AboutusFront/About.jsx +37 -0
- data/app/javascript/react/components/Accommodation/Accommodation.jsx +32 -0
- data/app/javascript/react/components/Accommodation/NormalListing.jsx +50 -0
- data/app/javascript/react/components/Accommodation/SpecialListing.jsx +51 -0
- data/app/javascript/react/components/Accountpage/AccountInfo.jsx +217 -0
- data/app/javascript/react/components/Accountpage/AccountPage.jsx +27 -0
- data/app/javascript/react/components/Accountpage/CommonPage.jsx +24 -0
- data/app/javascript/react/components/AddNewProperty/CommonLayout.jsx +68 -0
- data/app/javascript/react/components/AddNewProperty/Description.jsx +229 -0
- data/app/javascript/react/components/AddNewProperty/Details.jsx +234 -0
- data/app/javascript/react/components/AddNewProperty/Images.jsx +196 -0
- data/app/javascript/react/components/AddNewProperty/Location.jsx +239 -0
- data/app/javascript/react/components/AddNewProperty/Room.jsx +1132 -0
- data/app/javascript/react/components/AvatarDropdown/AvatarDropDown.jsx +142 -0
- data/app/javascript/react/components/BlogDesign/BlogsLatest.jsx +67 -0
- data/app/javascript/react/components/ContactUs/Contact.jsx +89 -0
- data/app/javascript/react/components/FacilitiesSection/Facilities.jsx +66 -0
- data/app/javascript/react/components/FixedNavbar/FixedNav.jsx +88 -0
- data/app/javascript/react/components/ForgetPassword/ForgetPassword.jsx +103 -0
- data/app/javascript/react/components/Gallery/Gallery.jsx +164 -0
- data/app/javascript/react/components/GalleryModalLight/GalleryModalLight.jsx +35 -0
- data/app/javascript/react/components/GallerySlider/GallerySlider.jsx +58 -0
- data/app/javascript/react/components/Headers/PropertyCard.jsx +46 -0
- data/app/javascript/react/components/HeroSectionDesign/BookingForm.jsx +178 -0
- data/app/javascript/react/components/HeroSectionDesign/HeroSection.jsx +29 -0
- data/app/javascript/react/components/HeroSectionDesign/MyPropertiesListing.jsx +104 -0
- data/app/javascript/react/components/HeroSectionDesign/PropertiesPage.jsx +122 -0
- data/app/javascript/react/components/HotelListing/Listing.jsx +48 -0
- data/app/javascript/react/components/Layout/Layout.js +18 -0
- data/app/javascript/react/components/Listing-stay-Detail/AmenitiesFeatures.jsx +58 -0
- data/app/javascript/react/components/Listing-stay-Detail/AmenitiesModal.jsx +250 -0
- data/app/javascript/react/components/Listing-stay-Detail/ApartmentCard.jsx +120 -0
- data/app/javascript/react/components/Listing-stay-Detail/BookingModal.jsx +398 -0
- data/app/javascript/react/components/Listing-stay-Detail/CheckoutForm.jsx +296 -0
- data/app/javascript/react/components/Listing-stay-Detail/ListingStayDetailPage.jsx +512 -0
- data/app/javascript/react/components/Listing-stay-Detail/PropertyDescription.jsx +76 -0
- data/app/javascript/react/components/Listing-stay-Detail/PropertyDetailsCard.jsx +62 -0
- data/app/javascript/react/components/Listing-stay-Detail/Reviews.jsx +132 -0
- data/app/javascript/react/components/Listing-stay-Detail/RoomDescriptionModal.jsx +105 -0
- data/app/javascript/react/components/Listing-stay-Detail/Rules.jsx +23 -0
- data/app/javascript/react/components/ListingImageGallery/ListingImageGallery.jsx +30 -0
- data/app/javascript/react/components/LoginPage/LoginPage.jsx +115 -0
- data/app/javascript/react/components/MobileNav/MobileMenu.jsx +47 -0
- data/app/javascript/react/components/Navbar/Navbar.jsx +25 -0
- data/app/javascript/react/components/Page404/Page404.jsx +30 -0
- data/app/javascript/react/components/PropertyListing/MyProperties.jsx +146 -0
- data/app/javascript/react/components/PropertyListing/StayBooking/BookingDetails.jsx +178 -0
- data/app/javascript/react/components/PropertyListing/StayBooking/MyBooking.jsx +83 -0
- data/app/javascript/react/components/ResetPassword/ResetPassword.jsx +117 -0
- data/app/javascript/react/components/SignupPage/SignupPage.jsx +185 -0
- data/app/javascript/react/components/SmallNavbar/SmallNav.jsx +51 -0
- data/app/javascript/react/components/SocialAuth/SocialAuth.jsx +21 -0
- data/app/javascript/react/components/StayCard/StayCard.jsx +69 -0
- data/app/javascript/react/components/StayCard/StayCard2.jsx +45 -0
- data/app/javascript/react/components/StayCard/StayCard3.jsx +45 -0
- data/app/javascript/react/components/TestimonialSection/Testimonial.jsx +113 -0
- data/app/javascript/react/components/Unauthorized/Unauthorized.jsx +12 -0
- data/app/javascript/react/data/jsons/__countryListing.json +201 -0
- data/app/javascript/react/packs/App.js +26 -0
- data/app/javascript/react/packs/index.jsx +38 -0
- data/app/javascript/react/packs/routes/ParentRoute.jsx +14 -0
- data/app/javascript/react/packs/routes/Route.jsx +163 -0
- data/app/javascript/react/pages/AccommodationList.jsx +21 -0
- data/app/javascript/react/pages/Home.jsx +32 -0
- data/app/javascript/react/redux/slices/AuthSlice/AuthSlice.jsx +100 -0
- data/app/javascript/react/redux/slices/PropertySlice/PropertySlice.jsx +722 -0
- data/app/javascript/react/redux/slices/PropertySlice/Searchslice.jsx +36 -0
- data/app/javascript/react/redux/slices/UserSlice/UserSlice.jsx +215 -0
- data/app/javascript/react/redux/store.js +35 -0
- data/app/javascript/react/shared/Avatar/Avatar.jsx +32 -0
- data/app/javascript/react/shared/Badge/Badge.jsx +33 -0
- data/app/javascript/react/shared/Button/Button.jsx +67 -0
- data/app/javascript/react/shared/Button/ButtonPrimary.jsx +11 -0
- data/app/javascript/react/shared/Button/ButtonSelect.jsx +9 -0
- data/app/javascript/react/shared/Checkbox/Checkbox.jsx +38 -0
- data/app/javascript/react/shared/CurrencySymbol.jsx +6 -0
- data/app/javascript/react/shared/DateField/CustomDatePicker.jsx +69 -0
- data/app/javascript/react/shared/FooterSection/Footer.jsx +75 -0
- data/app/javascript/react/shared/FormField/FormField.jsx +75 -0
- data/app/javascript/react/shared/FormItem/FormItem.jsx +20 -0
- data/app/javascript/react/shared/Input/Input.jsx +27 -0
- data/app/javascript/react/shared/Label/Label.jsx +12 -0
- data/app/javascript/react/shared/Modal.jsx +20 -0
- data/app/javascript/react/shared/NcImage/NcImage.jsx +101 -0
- data/app/javascript/react/shared/NcImage/PlaceIcon.jsx +31 -0
- data/app/javascript/react/shared/NcImage/placecImageIcon.svg +6 -0
- data/app/javascript/react/shared/Select/Select.jsx +20 -0
- data/app/javascript/react/styles/404error.scss +58 -0
- data/app/javascript/react/styles/ApartmentCard.scss +126 -0
- data/app/javascript/react/styles/BookingDetails.scss +457 -0
- data/app/javascript/react/styles/Modal.scss +36 -0
- data/app/javascript/react/styles/PropertiesPage.scss +219 -0
- data/app/javascript/react/styles/RenderSection.scss +480 -0
- data/app/javascript/react/styles/about.scss +97 -0
- data/app/javascript/react/styles/accountinfo.scss +67 -0
- data/app/javascript/react/styles/accountpage.scss +36 -0
- data/app/javascript/react/styles/amenitiesfeatures.scss +223 -0
- data/app/javascript/react/styles/application.scss +87 -0
- data/app/javascript/react/styles/avatar.scss +39 -0
- data/app/javascript/react/styles/avatardropdown.scss +57 -0
- data/app/javascript/react/styles/badge.scss +90 -0
- data/app/javascript/react/styles/blog.scss +100 -0
- data/app/javascript/react/styles/bookingform.scss +124 -0
- data/app/javascript/react/styles/button.scss +44 -0
- data/app/javascript/react/styles/buttonprimary.scss +32 -0
- data/app/javascript/react/styles/checkbox.scss +37 -0
- data/app/javascript/react/styles/commonlayout.scss +83 -0
- data/app/javascript/react/styles/commonpage.scss +51 -0
- data/app/javascript/react/styles/contact.scss +173 -0
- data/app/javascript/react/styles/customdatepicker.scss +120 -0
- data/app/javascript/react/styles/description.scss +21 -0
- data/app/javascript/react/styles/details.scss +88 -0
- data/app/javascript/react/styles/facilities.scss +131 -0
- data/app/javascript/react/styles/fixednavbar.scss +137 -0
- data/app/javascript/react/styles/fonts.scss +22 -0
- data/app/javascript/react/styles/footer.scss +300 -0
- data/app/javascript/react/styles/forgetpassword.scss +68 -0
- data/app/javascript/react/styles/formfield.scss +39 -0
- data/app/javascript/react/styles/formitem.scss +20 -0
- data/app/javascript/react/styles/gallery.scss +142 -0
- data/app/javascript/react/styles/gallerymodallight.scss +137 -0
- data/app/javascript/react/styles/galleryslider.scss +114 -0
- data/app/javascript/react/styles/header.scss +49 -0
- data/app/javascript/react/styles/herosection.scss +61 -0
- data/app/javascript/react/styles/images.scss +112 -0
- data/app/javascript/react/styles/input.scss +58 -0
- data/app/javascript/react/styles/label.scss +11 -0
- data/app/javascript/react/styles/listing.scss +94 -0
- data/app/javascript/react/styles/listingimagegallery.scss +57 -0
- data/app/javascript/react/styles/listingstaydetailpage.scss +887 -0
- data/app/javascript/react/styles/location.scss +66 -0
- data/app/javascript/react/styles/loginpage.scss +150 -0
- data/app/javascript/react/styles/mobilemenu.scss +53 -0
- data/app/javascript/react/styles/mybooking.scss +104 -0
- data/app/javascript/react/styles/myproperty.scss +51 -0
- data/app/javascript/react/styles/ncimage.scss +24 -0
- data/app/javascript/react/styles/normallisting.scss +95 -0
- data/app/javascript/react/styles/property-description.scss +75 -0
- data/app/javascript/react/styles/propertycard.scss +48 -0
- data/app/javascript/react/styles/propertydetailscard.scss +302 -0
- data/app/javascript/react/styles/resetpassword.scss +79 -0
- data/app/javascript/react/styles/reviews.scss +185 -0
- data/app/javascript/react/styles/room.scss +275 -0
- data/app/javascript/react/styles/rooms.scss +0 -0
- data/app/javascript/react/styles/select.scss +44 -0
- data/app/javascript/react/styles/signuppage.scss +132 -0
- data/app/javascript/react/styles/smallnav.scss +94 -0
- data/app/javascript/react/styles/socialauth.scss +62 -0
- data/app/javascript/react/styles/speciallisting.scss +94 -0
- data/app/javascript/react/styles/staycard.scss +77 -0
- data/app/javascript/react/styles/staycard2.scss +115 -0
- data/app/javascript/react/styles/testimonial.scss +216 -0
- data/app/javascript/react/styles/unauthorized.scss +22 -0
- data/app/javascript/react/styles/variables.scss +3 -0
- data/app/javascript/react/styles/wrapper.scss +4 -0
- data/app/javascript/react/utils/formSchema.js +120 -0
- data/app/javascript/react/utils/helpers/APIHelper.jsx +55 -0
- data/app/javascript/react/utils/helpers/ErrorHandler.js +21 -0
- data/app/javascript/react/utils/helpers/InfoHandler.js +15 -0
- data/app/javascript/react/utils/helpers/SuccessHandler.js +12 -0
- data/app/javascript/react/utils/helpers/isInViewPortIntersectionObserver.jsx +39 -0
- data/app/jobs/stay_commerce/frontend/application_job.rb +6 -0
- data/app/mailers/stay_commerce/frontend/application_mailer.rb +8 -0
- data/app/models/stay_commerce/frontend/application_record.rb +7 -0
- data/app/views/layouts/stay_commerce/frontend/application.html.erb +61 -0
- data/app/views/stay_commerce/frontend/welcome/index.html.erb +2 -0
- data/config/initializers/cors.rb +6 -0
- data/config/initializers/devise.rb +359 -0
- data/config/routes.rb +11 -0
- data/lib/stay_commerce/frontend/engine.rb +14 -0
- data/lib/stay_commerce/frontend/version.rb +5 -0
- data/lib/stay_commerce/frontend.rb +8 -0
- data/lib/tasks/stay_commerce/frontend_tasks.rake +4 -0
- metadata +370 -0
@@ -0,0 +1,122 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import GallerySlider from "../GallerySlider/GallerySlider";
|
3
|
+
import { useNavigate } from "react-router-dom";
|
4
|
+
import ButtonPrimary from "../../shared/Button/ButtonPrimary";
|
5
|
+
|
6
|
+
const PropertiesPage = ({
|
7
|
+
heading = "Explore Travel Experiences",
|
8
|
+
setAllData,
|
9
|
+
stayListings,
|
10
|
+
data,
|
11
|
+
}) => {
|
12
|
+
const staticProperties = [
|
13
|
+
{
|
14
|
+
id: 1,
|
15
|
+
name: "Phi Phi Islands Adventure Day Trip with Seaview Lunch by V. Marine Tour",
|
16
|
+
location: "Paris, France",
|
17
|
+
duration: "2 Days 1 Nights",
|
18
|
+
rating: 4.8,
|
19
|
+
reviews: 268,
|
20
|
+
price: 114,
|
21
|
+
discount: "20% OFF",
|
22
|
+
image:
|
23
|
+
"https://images.unsplash.com/photo-1544551763-46a013bb70d5?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80",
|
24
|
+
description:
|
25
|
+
"The Phi Phi archipelago is a must-visit while in Phuket, and this speedboat trip...",
|
26
|
+
bestPriceGuarantee: true,
|
27
|
+
freeCancellation: true,
|
28
|
+
},
|
29
|
+
];
|
30
|
+
const propertiesToRender =
|
31
|
+
Array.isArray(data) && data.length > 0
|
32
|
+
? data
|
33
|
+
: Array.isArray(stayListings) && stayListings.length > 0
|
34
|
+
? stayListings
|
35
|
+
: [];
|
36
|
+
const allPropertyIds = stayListings?.map((property) => property.id);
|
37
|
+
const navigate = useNavigate();
|
38
|
+
|
39
|
+
const handleClick = (id) => {
|
40
|
+
navigate(`/listing-stay-detail/${id}`);
|
41
|
+
};
|
42
|
+
|
43
|
+
const finalProperties = propertiesToRender.length
|
44
|
+
? propertiesToRender
|
45
|
+
: staticProperties;
|
46
|
+
|
47
|
+
return (
|
48
|
+
<div className="properties-page">
|
49
|
+
<div className="container">
|
50
|
+
<h2>{heading}</h2>
|
51
|
+
<div className="property-grid grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
|
52
|
+
{finalProperties.map((property, index) => (
|
53
|
+
<div key={property.id || index} className="property-card">
|
54
|
+
<div className="card-image-section">
|
55
|
+
{(property.discount || property.property_state) && (
|
56
|
+
<div className="discount-badge">
|
57
|
+
{property.discount || property.property_state}
|
58
|
+
</div>
|
59
|
+
)}
|
60
|
+
|
61
|
+
<GallerySlider
|
62
|
+
images={property.place_images || []}
|
63
|
+
alt={property.title}
|
64
|
+
/>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div className="card-content">
|
68
|
+
<div className="location-duration">
|
69
|
+
<span className="location">
|
70
|
+
{property.location || property.address}
|
71
|
+
</span>
|
72
|
+
</div>
|
73
|
+
<h3 className="property-title">
|
74
|
+
{property.name || property.title}
|
75
|
+
</h3>
|
76
|
+
|
77
|
+
<p className="description">{property.description}</p>
|
78
|
+
|
79
|
+
<div className="card-footer">
|
80
|
+
<div className="features">
|
81
|
+
{(property.bestPriceGuarantee ||
|
82
|
+
property.property_category) && (
|
83
|
+
<span className="feature-tag">
|
84
|
+
{property.bestPriceGuarantee
|
85
|
+
? "Best Price Guarantee"
|
86
|
+
: property.property_category}
|
87
|
+
</span>
|
88
|
+
)}
|
89
|
+
{(property.freeCancellation || property.property_type) && (
|
90
|
+
<span className="feature-tag">
|
91
|
+
{property.freeCancellation
|
92
|
+
? "Free Cancellation"
|
93
|
+
: property.property_type}
|
94
|
+
</span>
|
95
|
+
)}
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
<div className="custom-border"></div>
|
101
|
+
|
102
|
+
<div className="price-section">
|
103
|
+
<span className="duration">{property.duration}</span>
|
104
|
+
<div className="price-info">
|
105
|
+
<span className="price">From - ${property.price}</span>
|
106
|
+
<button
|
107
|
+
className="view-details-btn"
|
108
|
+
onClick={() => handleClick(property.slug)}
|
109
|
+
>
|
110
|
+
View Details
|
111
|
+
</button>
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
</div>
|
115
|
+
))}
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
);
|
120
|
+
};
|
121
|
+
|
122
|
+
export default PropertiesPage;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
2
|
+
import { useNavigate } from "react-router-dom";
|
3
|
+
import { useDispatch } from "react-redux";
|
4
|
+
import { getAllProperties } from "../../redux/slices/PropertySlice/PropertySlice";
|
5
|
+
import StayCard2 from "../StayCard/StayCard2";
|
6
|
+
|
7
|
+
function Listing() {
|
8
|
+
const navigate = useNavigate();
|
9
|
+
const dispatch = useDispatch();
|
10
|
+
const [page, setPage] = useState(1);
|
11
|
+
const [properties, setProperties] = useState([]);
|
12
|
+
|
13
|
+
const fetchProperties = async (pageNumber) => {
|
14
|
+
try {
|
15
|
+
const res = await dispatch(getAllProperties(pageNumber));
|
16
|
+
if (res?.payload?.properties) {
|
17
|
+
setProperties(res.payload.properties);
|
18
|
+
}
|
19
|
+
} catch (error) {
|
20
|
+
console.error("Failed to fetch properties", error);
|
21
|
+
}
|
22
|
+
};
|
23
|
+
|
24
|
+
useEffect(() => {
|
25
|
+
fetchProperties(page);
|
26
|
+
}, [page]);
|
27
|
+
|
28
|
+
return (
|
29
|
+
<div className="my-booking-container">
|
30
|
+
<div className="my-booking-content">
|
31
|
+
<h1 className="heading">Hotel Accommodation</h1>
|
32
|
+
<p className="subheading">
|
33
|
+
We all live in an age that belongs to the young at heart. Life that is
|
34
|
+
becoming extremely fast.
|
35
|
+
</p>
|
36
|
+
<div className="stay-cards">
|
37
|
+
{properties?.length > 0 ? (
|
38
|
+
properties?.slice(0, 3).map((room) => <StayCard2 booking={room} />)
|
39
|
+
) : (
|
40
|
+
<p className="no-results">No Property Found.</p>
|
41
|
+
)}
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
);
|
46
|
+
}
|
47
|
+
|
48
|
+
export default Listing;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import FixedNavbar from "../FixedNavbar/FixedNav";
|
3
|
+
import Footer from "../../shared/FooterSection/Footer";
|
4
|
+
import { Outlet } from "react-router-dom";
|
5
|
+
|
6
|
+
const Layout = () => {
|
7
|
+
return (
|
8
|
+
<>
|
9
|
+
<FixedNavbar />
|
10
|
+
<div className="content">
|
11
|
+
<Outlet />
|
12
|
+
</div>
|
13
|
+
<Footer />
|
14
|
+
</>
|
15
|
+
);
|
16
|
+
};
|
17
|
+
|
18
|
+
export default Layout;
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import React, { Fragment, useState } from "react";
|
2
|
+
import "../../styles/amenitiesfeatures.scss";
|
3
|
+
|
4
|
+
const AmenitiesFeatures = ({ propertyData }) => {
|
5
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
6
|
+
|
7
|
+
const openModal = () => setIsModalOpen(true);
|
8
|
+
const closeModal = () => setIsModalOpen(false);
|
9
|
+
return (
|
10
|
+
<div className="amenities-section">
|
11
|
+
<div className="amenities-header">
|
12
|
+
<h2>Features & Amenities</h2>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div className="amenities-grid">
|
16
|
+
{propertyData?.rooms
|
17
|
+
?.flatMap((room) => room.amenities)
|
18
|
+
.map((item) => {
|
19
|
+
const Icon = item.icon;
|
20
|
+
return (
|
21
|
+
<div key={item.id} className="amenity-item">
|
22
|
+
{Icon && <Icon className="amenity-icon" />}{" "}
|
23
|
+
<span>{item.name}</span>
|
24
|
+
</div>
|
25
|
+
);
|
26
|
+
})}
|
27
|
+
</div>
|
28
|
+
|
29
|
+
{isModalOpen && (
|
30
|
+
<div className="modal-overlay" onClick={closeModal}>
|
31
|
+
<div className="modal-container" onClick={(e) => e.stopPropagation()}>
|
32
|
+
<div className="modal-header">
|
33
|
+
<h3>Amenities</h3>
|
34
|
+
<button className="close-button" onClick={closeModal}>
|
35
|
+
×
|
36
|
+
</button>
|
37
|
+
</div>
|
38
|
+
<div className="modal-content">
|
39
|
+
{propertyData?.rooms
|
40
|
+
?.flatMap((room) => room.amenities)
|
41
|
+
.map((item) => {
|
42
|
+
const Icon = item.icon || "div";
|
43
|
+
return (
|
44
|
+
<div key={item.id} className="modal-amenity-item">
|
45
|
+
<Icon className="amenity-icon" />
|
46
|
+
<span>{item.name}</span>
|
47
|
+
</div>
|
48
|
+
);
|
49
|
+
})}
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
)}
|
54
|
+
</div>
|
55
|
+
);
|
56
|
+
};
|
57
|
+
|
58
|
+
export default AmenitiesFeatures;
|
@@ -0,0 +1,250 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { X } from "lucide-react";
|
3
|
+
|
4
|
+
const AmenitiesModal = ({
|
5
|
+
isOpen,
|
6
|
+
onClose,
|
7
|
+
room,
|
8
|
+
NcImage, // Pass NcImage component as prop
|
9
|
+
}) => {
|
10
|
+
const handleBackdropClick = (e) => {
|
11
|
+
if (e.target === e.currentTarget) {
|
12
|
+
onClose();
|
13
|
+
}
|
14
|
+
};
|
15
|
+
|
16
|
+
if (!isOpen || !room) return null;
|
17
|
+
|
18
|
+
const allItems = [
|
19
|
+
...(room?.features || []).map((item) => ({ ...item, type: "feature" })),
|
20
|
+
...(room?.amenities || []).map((item) => ({ ...item, type: "amenity" })),
|
21
|
+
];
|
22
|
+
|
23
|
+
return (
|
24
|
+
<div
|
25
|
+
className="modal-overlay"
|
26
|
+
onClick={handleBackdropClick}
|
27
|
+
style={{
|
28
|
+
position: "fixed",
|
29
|
+
top: 0,
|
30
|
+
left: 0,
|
31
|
+
right: 0,
|
32
|
+
bottom: 0,
|
33
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
34
|
+
display: "flex",
|
35
|
+
alignItems: "center",
|
36
|
+
justifyContent: "center",
|
37
|
+
zIndex: 1000,
|
38
|
+
padding: "20px",
|
39
|
+
}}
|
40
|
+
>
|
41
|
+
<div
|
42
|
+
className="modal-content"
|
43
|
+
style={{
|
44
|
+
backgroundColor: "white",
|
45
|
+
borderRadius: "12px",
|
46
|
+
padding: "24px",
|
47
|
+
maxWidth: "600px",
|
48
|
+
width: "100%",
|
49
|
+
maxHeight: "80vh",
|
50
|
+
overflowY: "auto",
|
51
|
+
position: "relative",
|
52
|
+
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
53
|
+
}}
|
54
|
+
>
|
55
|
+
{/* Close Button */}
|
56
|
+
<button
|
57
|
+
onClick={onClose}
|
58
|
+
style={{
|
59
|
+
position: "absolute",
|
60
|
+
top: "16px",
|
61
|
+
right: "16px",
|
62
|
+
background: "none",
|
63
|
+
border: "none",
|
64
|
+
cursor: "pointer",
|
65
|
+
padding: "8px",
|
66
|
+
borderRadius: "50%",
|
67
|
+
display: "flex",
|
68
|
+
alignItems: "center",
|
69
|
+
justifyContent: "center",
|
70
|
+
transition: "background-color 0.2s",
|
71
|
+
}}
|
72
|
+
onMouseEnter={(e) => (e.target.style.backgroundColor = "#f3f4f6")}
|
73
|
+
onMouseLeave={(e) => (e.target.style.backgroundColor = "transparent")}
|
74
|
+
>
|
75
|
+
<X size={20} />
|
76
|
+
</button>
|
77
|
+
|
78
|
+
{/* Modal Header */}
|
79
|
+
<div style={{ marginBottom: "24px", paddingRight: "40px" }}>
|
80
|
+
<h2
|
81
|
+
style={{
|
82
|
+
margin: 0,
|
83
|
+
fontSize: "24px",
|
84
|
+
fontWeight: "600",
|
85
|
+
color: "#111827",
|
86
|
+
}}
|
87
|
+
>
|
88
|
+
Features & Amenities
|
89
|
+
</h2>
|
90
|
+
<p
|
91
|
+
style={{ margin: "8px 0 0 0", color: "#6b7280", fontSize: "14px" }}
|
92
|
+
>
|
93
|
+
{room?.name}
|
94
|
+
</p>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
{/* Features Section */}
|
98
|
+
{room?.features && room?.features?.length > 0 && (
|
99
|
+
<div style={{ marginBottom: "32px" }}>
|
100
|
+
<h3
|
101
|
+
style={{
|
102
|
+
fontSize: "18px",
|
103
|
+
fontWeight: "600",
|
104
|
+
marginBottom: "16px",
|
105
|
+
color: "#374151",
|
106
|
+
borderBottom: "2px solid #e5e7eb",
|
107
|
+
paddingBottom: "8px",
|
108
|
+
}}
|
109
|
+
>
|
110
|
+
Features ({room?.features?.length})
|
111
|
+
</h3>
|
112
|
+
<div
|
113
|
+
className="amenities-grid"
|
114
|
+
style={{
|
115
|
+
display: "grid",
|
116
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))",
|
117
|
+
gap: "12px",
|
118
|
+
}}
|
119
|
+
>
|
120
|
+
{room?.features?.map((feature) => {
|
121
|
+
const IconComponent = feature?.icon_name || null;
|
122
|
+
|
123
|
+
return (
|
124
|
+
<div
|
125
|
+
key={feature?.id}
|
126
|
+
className="amenity-item"
|
127
|
+
style={{
|
128
|
+
display: "flex",
|
129
|
+
alignItems: "center",
|
130
|
+
gap: "12px",
|
131
|
+
padding: "12px",
|
132
|
+
backgroundColor: "#f9fafb",
|
133
|
+
borderRadius: "8px",
|
134
|
+
border: "1px solid #e5e7eb",
|
135
|
+
}}
|
136
|
+
>
|
137
|
+
{IconComponent && (
|
138
|
+
<div style={{ flexShrink: 0, color: "#6366f1" }}>
|
139
|
+
<IconComponent size={20} />
|
140
|
+
</div>
|
141
|
+
)}
|
142
|
+
<span
|
143
|
+
style={{
|
144
|
+
fontSize: "14px",
|
145
|
+
color: "#374151",
|
146
|
+
fontWeight: "500",
|
147
|
+
}}
|
148
|
+
>
|
149
|
+
{feature?.name}
|
150
|
+
</span>
|
151
|
+
</div>
|
152
|
+
);
|
153
|
+
})}
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
)}
|
157
|
+
|
158
|
+
{/* Amenities Section */}
|
159
|
+
{room?.amenities && room?.amenities?.length > 0 && (
|
160
|
+
<div>
|
161
|
+
<h3
|
162
|
+
style={{
|
163
|
+
fontSize: "18px",
|
164
|
+
fontWeight: "600",
|
165
|
+
marginBottom: "16px",
|
166
|
+
color: "#374151",
|
167
|
+
borderBottom: "2px solid #e5e7eb",
|
168
|
+
paddingBottom: "8px",
|
169
|
+
}}
|
170
|
+
>
|
171
|
+
Amenities ({room?.amenities?.length})
|
172
|
+
</h3>
|
173
|
+
<div
|
174
|
+
className="amenities-grid"
|
175
|
+
style={{
|
176
|
+
display: "grid",
|
177
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))",
|
178
|
+
gap: "12px",
|
179
|
+
}}
|
180
|
+
>
|
181
|
+
{room?.amenities?.map((amenity) => {
|
182
|
+
const IconComponent = amenity?.icon_name || null;
|
183
|
+
|
184
|
+
return (
|
185
|
+
<div
|
186
|
+
key={amenity?.id}
|
187
|
+
className="amenity-item"
|
188
|
+
style={{
|
189
|
+
display: "flex",
|
190
|
+
alignItems: "center",
|
191
|
+
gap: "12px",
|
192
|
+
padding: "12px",
|
193
|
+
backgroundColor: "#f0f9ff",
|
194
|
+
borderRadius: "8px",
|
195
|
+
border: "1px solid #e0f2fe",
|
196
|
+
}}
|
197
|
+
>
|
198
|
+
{amenity?.image ? (
|
199
|
+
<NcImage
|
200
|
+
src={amenity?.image}
|
201
|
+
alt={amenity?.name}
|
202
|
+
className="w-5 h-5 object-cover rounded-md flex-shrink-0"
|
203
|
+
style={{
|
204
|
+
width: "20px",
|
205
|
+
height: "20px",
|
206
|
+
objectFit: "cover",
|
207
|
+
borderRadius: "4px",
|
208
|
+
flexShrink: 0,
|
209
|
+
}}
|
210
|
+
/>
|
211
|
+
) : (
|
212
|
+
IconComponent && (
|
213
|
+
<div style={{ flexShrink: 0, color: "#0ea5e9" }}>
|
214
|
+
<IconComponent size={20} />
|
215
|
+
</div>
|
216
|
+
)
|
217
|
+
)}
|
218
|
+
<span
|
219
|
+
style={{
|
220
|
+
fontSize: "14px",
|
221
|
+
color: "#374151",
|
222
|
+
fontWeight: "500",
|
223
|
+
}}
|
224
|
+
>
|
225
|
+
{amenity?.name}
|
226
|
+
</span>
|
227
|
+
</div>
|
228
|
+
);
|
229
|
+
})}
|
230
|
+
</div>
|
231
|
+
</div>
|
232
|
+
)}
|
233
|
+
{(!room?.features || room?.features?.length === 0) &&
|
234
|
+
(!room?.amenities || room?.amenities?.length === 0) && (
|
235
|
+
<div
|
236
|
+
style={{
|
237
|
+
textAlign: "center",
|
238
|
+
padding: "40px 20px",
|
239
|
+
color: "#6b7280",
|
240
|
+
}}
|
241
|
+
>
|
242
|
+
<p>No features or amenities available for this room.</p>
|
243
|
+
</div>
|
244
|
+
)}
|
245
|
+
</div>
|
246
|
+
</div>
|
247
|
+
);
|
248
|
+
};
|
249
|
+
|
250
|
+
export default AmenitiesModal;
|
@@ -0,0 +1,120 @@
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
2
|
+
import "../../styles/ApartmentCard.scss";
|
3
|
+
import { getBookingDetails } from "../../redux/slices/PropertySlice/PropertySlice";
|
4
|
+
import { useDispatch } from "react-redux";
|
5
|
+
import { useNavigate, useParams } from "react-router-dom";
|
6
|
+
import GallerySlider from "../GallerySlider/GallerySlider";
|
7
|
+
import axios from "axios";
|
8
|
+
import CheckOutPagePageMain from "./CheckoutForm";
|
9
|
+
import Modal from "../../shared/Modal";
|
10
|
+
|
11
|
+
const ApartmentCard = () => {
|
12
|
+
const dispatch = useDispatch();
|
13
|
+
const { id } = useParams();
|
14
|
+
const [bookingRequestDetails, setBookingRequestDetails] = useState(null);
|
15
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
16
|
+
const Address = `${bookingRequestDetails?.property?.city}, ${bookingRequestDetails?.property?.state}`;
|
17
|
+
const period = `${bookingRequestDetails?.check_in_date} to ${bookingRequestDetails?.check_out_date}`;
|
18
|
+
const requestedBy = bookingRequestDetails?.user?.full_name;
|
19
|
+
const roomName = bookingRequestDetails?.line_items[0]?.rooms?.name;
|
20
|
+
const roomImages = bookingRequestDetails?.line_items[0]?.rooms?.room_images;
|
21
|
+
const navigate = useNavigate();
|
22
|
+
|
23
|
+
const fetchAllManageBooking = async () => {
|
24
|
+
const action = await dispatch(getBookingDetails(id));
|
25
|
+
if (action?.payload?.success) {
|
26
|
+
const data = action.payload.booking;
|
27
|
+
setBookingRequestDetails(data);
|
28
|
+
}
|
29
|
+
};
|
30
|
+
useEffect(() => {
|
31
|
+
fetchAllManageBooking();
|
32
|
+
}, [dispatch]);
|
33
|
+
|
34
|
+
return (
|
35
|
+
<div className="apartment-card">
|
36
|
+
<div className="apartment-image">
|
37
|
+
<GallerySlider images={roomImages} style={{ height: "300px" }} />
|
38
|
+
</div>
|
39
|
+
<div className="apartment-details">
|
40
|
+
<h2 className="title">{roomName}</h2>
|
41
|
+
<p className="location">{Address}</p>
|
42
|
+
<div className="info-grid">
|
43
|
+
<div className="info-row">
|
44
|
+
<span className="info-label">Period :</span>
|
45
|
+
<span className="info-value">{period}</span>
|
46
|
+
</div>
|
47
|
+
<div className="info-row">
|
48
|
+
<span className="info-label">Invoice No :</span>
|
49
|
+
<span className="info-value">{bookingRequestDetails?.number}</span>
|
50
|
+
</div>
|
51
|
+
<div className="info-row">
|
52
|
+
<span className="info-label">Guest</span>
|
53
|
+
<span className="info-value">
|
54
|
+
{bookingRequestDetails?.number_of_guests}
|
55
|
+
</span>
|
56
|
+
</div>
|
57
|
+
<div className="info-row">
|
58
|
+
<span className="info-label">Amount:</span>
|
59
|
+
<span className="info-value">
|
60
|
+
${bookingRequestDetails?.total_amount}
|
61
|
+
</span>
|
62
|
+
</div>
|
63
|
+
</div>
|
64
|
+
{bookingRequestDetails?.status !== "confirmed" && (
|
65
|
+
<button
|
66
|
+
onClick={() => setIsModalOpen(true)}
|
67
|
+
className="pay-button"
|
68
|
+
style={{
|
69
|
+
marginTop: 20,
|
70
|
+
padding: "10px 24px",
|
71
|
+
backgroundColor: "#6772e5",
|
72
|
+
color: "#fff",
|
73
|
+
fontSize: "16px",
|
74
|
+
fontWeight: 600,
|
75
|
+
border: "none",
|
76
|
+
borderRadius: 6,
|
77
|
+
cursor: "pointer",
|
78
|
+
width: "100%",
|
79
|
+
}}
|
80
|
+
u
|
81
|
+
>
|
82
|
+
Pay with Cards
|
83
|
+
</button>
|
84
|
+
)}
|
85
|
+
{bookingRequestDetails?.status === "confirmed" && (
|
86
|
+
<button
|
87
|
+
onClick={() =>
|
88
|
+
navigate(`/bookingDetails/${bookingRequestDetails?.id}`)
|
89
|
+
}
|
90
|
+
className="pay-button"
|
91
|
+
style={{
|
92
|
+
marginTop: 20,
|
93
|
+
padding: "10px 24px",
|
94
|
+
backgroundColor: "#6772e5",
|
95
|
+
color: "#fff",
|
96
|
+
fontSize: "16px",
|
97
|
+
fontWeight: 600,
|
98
|
+
border: "none",
|
99
|
+
borderRadius: 6,
|
100
|
+
cursor: "pointer",
|
101
|
+
width: "100%",
|
102
|
+
}}
|
103
|
+
>
|
104
|
+
🎉 Booking confirmed! View Booking
|
105
|
+
</button>
|
106
|
+
)}
|
107
|
+
|
108
|
+
<Modal isOpen={isModalOpen} onClose={() => setIsModalOpen(false)}>
|
109
|
+
<CheckOutPagePageMain
|
110
|
+
bookingId={bookingRequestDetails?.id}
|
111
|
+
totalAmount={bookingRequestDetails?.total_amount * 100}
|
112
|
+
BookingStatus={bookingRequestDetails?.status}
|
113
|
+
/>
|
114
|
+
</Modal>
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
);
|
118
|
+
};
|
119
|
+
|
120
|
+
export default ApartmentCard;
|