Skip to content

Commit

Permalink
adds categorysearch component
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthlatest committed Apr 12, 2017
1 parent 4f1302b commit 3faea4f
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var {
ReactiveBase,
CategorySearch,
RatingsFilter,
ResultCard
} = ReactiveSearch;
Expand All @@ -24,17 +25,34 @@ var Testing = React.createClass({
>
<div className="row reverse-labels">
<div className="col s6 col-xs-6">
<RatingsFilter
componentId="RatingsSensor"
appbaseField="rating"
title="RatingsFilter"
data={
[{ start: 4, end: 5, label: "4 stars and up" },
{ start: 3, end: 5, label: "3 stars and up" },
{ start: 2, end: 5, label: "2 stars and up" },
{ start: 1, end: 5, label: "> 1 stars" }]
}
/>
<div className="row">
<div className="col s12 col-xs-12">
<CategorySearch
componentId="SearchSensor"
appbaseField="name"
categoryField="brand.raw"
placeholder="Search Cars"
autocomplete={false}
/>
</div>
<div className="col s12 col-xs-12">
<RatingsFilter
componentId="RatingsSensor"
appbaseField="rating"
title="RatingsFilter"
data={
[{ start: 4, end: 5, label: "4 stars and up" },
{ start: 3, end: 5, label: "3 stars and up" },
{ start: 2, end: 5, label: "2 stars and up" },
{ start: 1, end: 5, label: "> 1 stars" }]
}
defaultSelected={{
"start": 3,
"end": 5
}}
/>
</div>
</div>
</div>
<div className="col s6 col-xs-6">
<ResultCard
Expand Down Expand Up @@ -62,7 +80,7 @@ var Testing = React.createClass({
}
]}
react={{
and: "RatingsSensor"
and: ["RatingsSensor", "SearchSensor"]
}}
/>
</div>
Expand Down

0 comments on commit 3faea4f

Please sign in to comment.