-
Notifications
You must be signed in to change notification settings - Fork 2
Property Components
The src/components/property/ and src/components/property-filters/ directories contain the components that power property listings, detail pages, and the filter experience. Together they compose the three property-facing routes: the grid listing (/properties), the sidebar listing (/property-sidebar), and the detail page (/property/:id). A shared PropertyItem card is the atomic unit reused by the home page, locality templates, map search, and listing pages.
Note: the legacy spec referenced
PropertyList,PropertyDetails, andPropertyFilterfiles. Those names do not exist in the current codebase; the equivalent responsibilities live inPropertyPageSection,PropertyDetailsSection, andPropertyFiltersrespectively.
| File | Purpose |
|---|---|
src/components/property/PropertyItem.jsx |
Atomic property card with share modal, compare, trust badges |
src/components/property/Property.jsx |
Home-page "Latest property" section, reads store recommendations |
src/components/property/PropertyTwo.jsx |
Tabbed property grid used by locality templates |
src/components/property/PropertyPageSection.jsx |
Full /properties listing page with SWR, drawer filters, compare tray |
src/components/property/PropertySidebarSection.jsx |
/property-sidebar listing with SearchSidebar
|
src/components/property/PropertyDetailsSection.jsx |
/property/:id detail page (1300+ lines): media tabs, lightbox, VR, visit scheduling |
src/components/property/PropertyActions.jsx |
Like / share / print toolbar for detail page |
src/components/property/PropertyQuickFilters.jsx |
Quick-filter chips on the map page |
src/components/property/PropertyListControls.jsx |
List/grid and sort controls |
src/components/property/FloorPlan.jsx |
Static floor-plan section with tabs (marketing) |
src/components/property/ListingPropertyInformation.jsx |
Static "Details Information" form card for the legacy add-listing wizard |
src/components/property/LazyVRPlayer.jsx |
Lazy-loaded 360° VR tour player |
src/components/property-filters/PropertyFilters.jsx |
Full filter panel with saved searches, chips, mobile drawer mode |
src/components/property-filters/AdvancedPropertyFilter.jsx |
Formik-powered advanced search form for landing pages |
src/components/property-filters/PropertyFilterBottom.jsx |
Results count, sort dropdown, list/grid toggle |
src/components/property-filters/PropertyTopBar.jsx |
Top search bar with recent searches and Places autocomplete |
PropertyItem.jsx is the most reused component in the property domain. It accepts a property object plus styling props (itemClass, btnClass, badgeText, badgeClass, iconsClass, btnRenderBottom, btnRenderRight, showFeatureBadges) so the same card can render in compact, shaped, or full layouts. Responsibilities:
- Generates descriptive
alttext from BHK, type, purpose, locality, and furnishing viagetPropertyTypeLabel/getListingLabelfromsrc/utils/propertyTaxonomy. - Falls back to
property-1.webpwhen the image URL is empty or a Kuula VR link. - Renders a
ShareModalwith copy-link and nativenavigator.sharesupport, usingreact-toastifyfor confirmation. - Integrates with
usePropertyStore(swipe/like),useAuthStore, anduseCompareStore.
PropertyItem is consumed by Property, PropertyTwo, PropertyPageSection, PropertySidebarSection, PropertyDetailsSection (related listings), MapLocationSection, and LocalityTemplate.
Property.jsx reads recommendations from usePropertyStore (or accepts properties / loading props to override). It shows up to six PropertyItem cards in a 3-column grid with loading skeletons, an error state, and an empty state. A "Sell All Listing" Button links to /properties.
PropertyTwo.jsx is a highly configurable section used by src/pages/localities/LocalityTemplate.jsx. Props control sectionClass, containerClass, heading copy, showTabs, maxItems, grid item class, and the PropertyItem style class. It uses react-tabs with propertyTwoTabs from HomeThreeData; each tab panel renders the same recommendation list (the tabs are presentational). Loading and error states mirror Property.
PropertyPageSection.jsx is the /properties page body (~560 lines). It wires together:
-
useSWRfor data fetching withpropertyAPIServiceandparsePropertySearchParams. -
PropertyTopBar(search + recent searches),PropertyFilters(in a focus-trapped drawer),PropertyFilterBottom(sort + list/grid). -
Paginationfromsrc/common/ui/Pagination. - A comparison tray from
useCompareStore(compareList,isCompareOpen,removeCompare,clearCompare,closeCompare). - Body-scroll locking and a Tab-key trap while the filter drawer is open;
Escapecloses it and restores focus to the trigger. -
viewModeread from theviewsearch param (listorgrid).
PropertySidebarSection.jsx renders the /property-sidebar layout: a PropertyFilterBottom header, then a two-column row with the SearchSidebar + LocationSearchInput on the left and the property grid on the right. It pushes filters into the global usePropertyStore so they persist across the main listing and sidebar pages, and fetches with lat / lng / radius: 10 / sort_by: 'distance' from useLocationStore.
PropertyDetailsSection.jsx is the largest component in the repo (~1300 lines). It renders /property/:id and includes:
-
Media tabs (Photos / 360° Tour / Video) with
getMediaTabDefaultselecting the initial tab based on available media.parseVideoUrlhandles YouTube, Vimeo, native mp4/webm, and generic iframes. -
Lightbox via
yet-another-react-lightboxwithZoomandThumbnailsplugins. -
VR tours through
LazyVRPlayer(lazy-loaded). -
Visit scheduling via
useVisitStoreandlocalInputToServerTimestamp. - PropertyActions toolbar (like, share dropdown, print).
-
Related listings using
PropertyItem. -
WhatsAppButton,CommonSidebar,LoadingSkeleton,LazyImage. -
hapticLight/hapticSuccessfromsrc/utils/hapticFeedbackfor mobile feedback. - Currency formatting (
₹withen-INlocale) and date formatting helpers.
PropertyActions.jsx is the toolbar embedded in the detail page. It accepts property, onLikeToggle, isLiked, likeLoading. Share options: WhatsApp (with UTM params), Facebook, Twitter, copy link. A print button calls window.print(). The share dropdown closes on outside-click (mousedown) and Escape.
FloorPlan.jsx is a static marketing section (not the dynamic floor-plan designer). It uses react-tabs with floorTabLists / floorTabPanels from HomeTwoData to show a fixed floor-plan image and tabbed specs. It is unrelated to the /design-blueprint 3D tool.
ListingPropertyInformation.jsx is a static "Details Information" card (Property Id, Area Size, Bedrooms, Bathrooms, Garages, Year Build, Amenities checkboxes from addAmenities in OthersPageData). It is composed into the legacy AddListingForm alongside the src/common/listing/ sections.
PropertyFilters.jsx (~968 lines) is the primary filter panel. Props: showAdvanced, isMobile, onCloseDrawer. It binds to usePropertyStore (filters, updateFilter, clearFilters, applyFilters, setFilters, filtersChanged, getActiveFiltersCount) and useLocationStore (setLocation). Features:
- Purpose, property type, price, bedrooms, bathrooms, area, amenities, features, parking, floor, age, gender preference, sharing type, short-stay filters.
- Filter chips with per-chip remove animation (
removingChipstate). -
Saved searches persisted to
localStorageunderproperty_saved_searches(no auth required). - Toast notifications for filter actions.
- Taxonomy helpers from
src/utils/propertyTaxonomy(COMMERCIAL_PROPERTY_TYPES,PROPERTY_TYPE_FILTER_OPTIONS,PURPOSE_OPTIONS,SHARING_TYPE_OPTIONS,includesPgOrFlatmateType,isCommercialSelection).
AdvancedPropertyFilter.jsx is a Formik + Yup form used on programmatic SEO landing pages. It collects the full filter set (keyword, purpose, types, location, price, rooms, area, amenities, features, parking, floor, age, gender, sharing, short-stay dates) and navigates to /properties?... via buildPropertySearchQuery from src/utils/propertyFilters. It embeds GooglePlacesInput for location.
PropertyFilterBottom.jsx is the results header. Props: total, currentPage, viewMode, onViewModeChange. It shows "Showing X–Y of Z properties", a sort <select> (newest, distance, price_low, price_high, popular, relevance), and ListGridButtons. Sort changes call updateFilter('sort_by', ...) + applyFilters() and update the URL via useI18nNavigate.
PropertyTopBar.jsx is the top search bar on the listing page. It maintains recent searches in localStorage, shows a suggestion dropdown, and embeds GooglePlacesInput. Click-outside and Escape close the suggestions.
PropertyPageSection
├── PropertyTopBar (search)
├── PropertyFilters (drawer, focus-trapped)
├── PropertyFilterBottom (sort + view toggle)
├── PropertyItem[] (grid or list)
├── Pagination
└── CompareTray (useCompareStore)
PropertySidebarSection
├── PropertyFilterBottom
├── SearchSidebar + LocationSearchInput
└── PropertyItem[]
PropertyDetailsSection
├── MediaTabs (Photos / VR / Video)
├── Lightbox (yet-another-react-lightbox)
├── LazyVRPlayer
├── PropertyActions
├── CommonSidebar
└── PropertyItem[] (related)
-
Property Pages for the route-level wrappers (
Property.jsx,PropertySidebar.jsx,PropertyDetails.jsx). - Property Search for the store, service, and filter utilities.
-
Maps & Places for
GooglePlacesInputand the map listing page. -
UI Components for
LoadingSkeleton,WhatsAppButton,TrustBadge.