Property Results
PropertyResults
The PropertyResults
component will render search results to the page.
It will render each property as one of the item components provided depending on whether the hash is #/grid
or #/list
. These components will receive the property
as a prop.
You can also specify a defaultView
prop as either 'grid', 'list' or 'map' for that view to be rendered when one of the other hashes isn't present.
Props
GridItem
- Component to render for each property ingrid
view. Default isnull
.ListItem
- Component to render for each property inlist
view. Default isnull
.defaultView
- The default view to display when no hash is present. Default islist
.infiniteScroll
enables infinite scroll (automatically loading the next page of results when the user scrolls to the bottom of the results container). Default isfalse
.noMap
- pass this if you do not want thePropertyResults
component to include a map view (in case you want to render the map separately).
The inserts prop
caution
The inserts prop is currently in alpha, therefore it does not support multiple components.
inserts
can optionally be passed to thePropertyResults
as an array in order to render other components at certain intervals between the search results. This is commonly used to insert adverts, banners or call-to-actions. The array must contain an object with thecomponent
andfrequency
keys. Thecomponent
is what you would like to render and thefrequency
is how often you would like to render it, i.e you want your banner to after render every third item in the grid.
See example below:
- also, there's an alternative inserts logic, it works via indexes. It's used when you want to show a component after a specific index in the property list. Similar to the frequency, the array must contain an object with the component and index keys. The component is what you would like to render and the index indicates the position of the property card after which the component will be rendered. It supports multiple inserts.
See example below:
LoadMoreButton
If you wish to control pagination asynchronously using a button, you can use the LoadMoreButton
component. It will automatically disappear once there are no more properties to render.
SavePropertyButton
Button to add/remove a property from the user's saved properties.
Props
propertyId
- The ID of the property.UnsavedComponent
- component or JSX to render when the property is not currently saved.SavedComponent
- component or JSX to render when the property is saved.
RemoveSavedPropertyButton
A button/link to remove a saved property from the user's collection. This is mainly useful for custom user profile systems where the user can manage their saved properties.
Props
propertyId
- The ID of the property.
SortOrderSelect
Props
reactSelect
- renders a decorated dropdown instead of a regular<select>
if present.defaultSort
- The default sort order.