|
2 | 2 | AtomicBreadbox, |
3 | 3 | AtomicColorFacet, |
4 | 4 | AtomicDidYouMean, |
5 | | - AtomicExternal, |
6 | 5 | AtomicFacet, |
7 | 6 | AtomicFacetManager, |
8 | 7 | AtomicFormatCurrency, |
@@ -108,137 +107,121 @@ export const AtomicPageWrapper: FunctionComponent<Props> = ({ |
108 | 107 | } |
109 | 108 |
|
110 | 109 | return ( |
111 | | - <> |
112 | | - <AtomicExternal selector="atomic-search-interface"> |
113 | | - <AtomicSearchBox></AtomicSearchBox> |
114 | | - <AtomicFacet field="source" label="Source" /> |
115 | | - <AtomicFacet field="objecttype" label="Type" /> |
116 | | - <AtomicQuerySummary /> |
117 | | - </AtomicExternal> |
118 | | - |
119 | | - <AtomicSearchInterface |
120 | | - engine={engine} |
121 | | - fieldsToInclude={[ |
122 | | - 'ec_price', |
123 | | - 'ec_rating', |
124 | | - 'ec_images', |
125 | | - 'ec_brand', |
126 | | - 'cat_platform', |
127 | | - 'cat_condition', |
128 | | - 'cat_categories', |
129 | | - 'cat_review_count', |
130 | | - 'cat_color', |
131 | | - ]} |
132 | | - localization={(i18n) => { |
133 | | - i18n.addResourceBundle('en', 'translation', { |
134 | | - 'no-ratings-available': 'No ratings available', |
135 | | - }); |
136 | | - }} |
137 | | - > |
138 | | - <AtomicSearchLayout> |
139 | | - <AtomicLayoutSection section="search"> |
140 | | - <AtomicSearchBox> |
141 | | - <AtomicSearchBoxQuerySuggestions /> |
142 | | - {options.recentQueries && <AtomicSearchBoxRecentQueries />} |
143 | | - {options.instantResults && ( |
144 | | - <AtomicSearchBoxInstantResults |
145 | | - template={InstantResultsTemplate} |
146 | | - imageSize="small" |
147 | | - ariaLabelGenerator={InstantResultsAriaLabelTemplate} |
148 | | - /> |
149 | | - )} |
150 | | - </AtomicSearchBox> |
151 | | - </AtomicLayoutSection> |
152 | | - <AtomicLayoutSection section="facets"> |
153 | | - <AtomicFacetManager> |
154 | | - <AtomicFacet field="source" label="Source" /> |
155 | | - <AtomicFacet field="objecttype" label="Type" /> |
156 | | - <AtomicNumericFacet |
157 | | - field="cat_review_count" |
158 | | - label="Amount of reviews" |
159 | | - displayValuesAs="link" |
160 | | - > |
161 | | - <AtomicNumericRange start={0} end={150} label="Few" /> |
162 | | - <AtomicNumericRange |
163 | | - start={150} |
164 | | - end={650} |
165 | | - label="A moderate amount" |
166 | | - /> |
167 | | - <AtomicNumericRange |
168 | | - start={650} |
169 | | - end={9999999999} |
170 | | - label="A lot" |
171 | | - /> |
172 | | - </AtomicNumericFacet> |
173 | | - <AtomicColorFacet |
174 | | - field="cat_color" |
175 | | - label="Color" |
176 | | - numberOfValues={6} |
177 | | - sortCriteria="occurrences" |
| 110 | + <AtomicSearchInterface |
| 111 | + engine={engine} |
| 112 | + fieldsToInclude={[ |
| 113 | + 'ec_price', |
| 114 | + 'ec_rating', |
| 115 | + 'ec_images', |
| 116 | + 'ec_brand', |
| 117 | + 'cat_platform', |
| 118 | + 'cat_condition', |
| 119 | + 'cat_categories', |
| 120 | + 'cat_review_count', |
| 121 | + 'cat_color', |
| 122 | + ]} |
| 123 | + localization={(i18n) => { |
| 124 | + i18n.addResourceBundle('en', 'translation', { |
| 125 | + 'no-ratings-available': 'No ratings available', |
| 126 | + }); |
| 127 | + }} |
| 128 | + > |
| 129 | + <AtomicSearchLayout> |
| 130 | + <AtomicLayoutSection section="search"> |
| 131 | + <AtomicSearchBox> |
| 132 | + <AtomicSearchBoxQuerySuggestions /> |
| 133 | + {options.recentQueries && <AtomicSearchBoxRecentQueries />} |
| 134 | + {options.instantResults && ( |
| 135 | + <AtomicSearchBoxInstantResults |
| 136 | + template={InstantResultsTemplate} |
| 137 | + imageSize="small" |
| 138 | + ariaLabelGenerator={InstantResultsAriaLabelTemplate} |
178 | 139 | /> |
179 | | - <AtomicNumericFacet |
180 | | - field="ec_price" |
181 | | - label="Cost" |
182 | | - withInput="integer" |
183 | | - > |
184 | | - <AtomicFormatCurrency currency="USD" /> |
185 | | - </AtomicNumericFacet> |
186 | | - <AtomicTimeframeFacet withDatePicker label="Listed within"> |
187 | | - <AtomicTimeframe unit="hour" /> |
188 | | - <AtomicTimeframe unit="day" /> |
189 | | - <AtomicTimeframe unit="week" /> |
190 | | - <AtomicTimeframe unit="month" /> |
191 | | - <AtomicTimeframe unit="quarter" /> |
192 | | - <AtomicTimeframe unit="year" /> |
193 | | - <AtomicTimeframe unit="year" amount={10} period="next" /> |
194 | | - </AtomicTimeframeFacet> |
195 | | - <AtomicRatingFacet |
196 | | - field="ec_rating" |
197 | | - label="Rating" |
198 | | - numberOfIntervals={5} |
| 140 | + )} |
| 141 | + </AtomicSearchBox> |
| 142 | + </AtomicLayoutSection> |
| 143 | + <AtomicLayoutSection section="facets"> |
| 144 | + <AtomicFacetManager> |
| 145 | + <AtomicFacet field="source" label="Source" /> |
| 146 | + <AtomicFacet field="objecttype" label="Type" /> |
| 147 | + <AtomicNumericFacet |
| 148 | + field="cat_review_count" |
| 149 | + label="Amount of reviews" |
| 150 | + displayValuesAs="link" |
| 151 | + > |
| 152 | + <AtomicNumericRange start={0} end={150} label="Few" /> |
| 153 | + <AtomicNumericRange |
| 154 | + start={150} |
| 155 | + end={650} |
| 156 | + label="A moderate amount" |
199 | 157 | /> |
200 | | - <AtomicRatingRangeFacet |
201 | | - field="ec_rating" |
202 | | - label="Rating Range" |
203 | | - numberOfIntervals={5} |
204 | | - facetId="ec_rating_range" |
| 158 | + <AtomicNumericRange start={650} end={9999999999} label="A lot" /> |
| 159 | + </AtomicNumericFacet> |
| 160 | + <AtomicColorFacet |
| 161 | + field="cat_color" |
| 162 | + label="Color" |
| 163 | + numberOfValues={6} |
| 164 | + sortCriteria="occurrences" |
| 165 | + /> |
| 166 | + <AtomicNumericFacet |
| 167 | + field="ec_price" |
| 168 | + label="Cost" |
| 169 | + withInput="integer" |
| 170 | + > |
| 171 | + <AtomicFormatCurrency currency="USD" /> |
| 172 | + </AtomicNumericFacet> |
| 173 | + <AtomicTimeframeFacet withDatePicker label="Listed within"> |
| 174 | + <AtomicTimeframe unit="hour" /> |
| 175 | + <AtomicTimeframe unit="day" /> |
| 176 | + <AtomicTimeframe unit="week" /> |
| 177 | + <AtomicTimeframe unit="month" /> |
| 178 | + <AtomicTimeframe unit="quarter" /> |
| 179 | + <AtomicTimeframe unit="year" /> |
| 180 | + <AtomicTimeframe unit="year" amount={10} period="next" /> |
| 181 | + </AtomicTimeframeFacet> |
| 182 | + <AtomicRatingFacet |
| 183 | + field="ec_rating" |
| 184 | + label="Rating" |
| 185 | + numberOfIntervals={5} |
| 186 | + /> |
| 187 | + <AtomicRatingRangeFacet |
| 188 | + field="ec_rating" |
| 189 | + label="Rating Range" |
| 190 | + numberOfIntervals={5} |
| 191 | + facetId="ec_rating_range" |
| 192 | + /> |
| 193 | + </AtomicFacetManager> |
| 194 | + </AtomicLayoutSection> |
| 195 | + <AtomicLayoutSection section="main"> |
| 196 | + <AtomicLayoutSection section="status"> |
| 197 | + <AtomicBreadbox /> |
| 198 | + <AtomicQuerySummary /> |
| 199 | + <AtomicRefineToggle /> |
| 200 | + <AtomicSortDropdown> |
| 201 | + <AtomicSortExpression label="relevance" expression="relevancy" /> |
| 202 | + <AtomicSortExpression |
| 203 | + label="Price (low to high)" |
| 204 | + expression="ec_price ascending" |
205 | 205 | /> |
206 | | - </AtomicFacetManager> |
207 | | - </AtomicLayoutSection> |
208 | | - <AtomicLayoutSection section="main"> |
209 | | - <AtomicLayoutSection section="status"> |
210 | | - <AtomicBreadbox /> |
211 | | - <AtomicQuerySummary /> |
212 | | - <AtomicRefineToggle /> |
213 | | - <AtomicSortDropdown> |
214 | | - <AtomicSortExpression |
215 | | - label="relevance" |
216 | | - expression="relevancy" |
217 | | - /> |
218 | | - <AtomicSortExpression |
219 | | - label="Price (low to high)" |
220 | | - expression="ec_price ascending" |
221 | | - /> |
222 | | - <AtomicSortExpression |
223 | | - label="Price (high to low)" |
224 | | - expression="ec_price descending" |
225 | | - /> |
226 | | - </AtomicSortDropdown> |
| 206 | + <AtomicSortExpression |
| 207 | + label="Price (high to low)" |
| 208 | + expression="ec_price descending" |
| 209 | + /> |
| 210 | + </AtomicSortDropdown> |
227 | 211 |
|
228 | | - <AtomicDidYouMean /> |
229 | | - </AtomicLayoutSection> |
230 | | - <AtomicLayoutSection section="results"> |
231 | | - {children} |
232 | | - <AtomicQueryError /> |
233 | | - <AtomicNoResults /> |
234 | | - </AtomicLayoutSection> |
235 | | - <AtomicLayoutSection section="pagination"> |
236 | | - <AtomicLoadMoreResults /> |
237 | | - </AtomicLayoutSection> |
| 212 | + <AtomicDidYouMean /> |
238 | 213 | </AtomicLayoutSection> |
239 | | - </AtomicSearchLayout> |
240 | | - </AtomicSearchInterface> |
241 | | - </> |
| 214 | + <AtomicLayoutSection section="results"> |
| 215 | + {children} |
| 216 | + <AtomicQueryError /> |
| 217 | + <AtomicNoResults /> |
| 218 | + </AtomicLayoutSection> |
| 219 | + <AtomicLayoutSection section="pagination"> |
| 220 | + <AtomicLoadMoreResults /> |
| 221 | + </AtomicLayoutSection> |
| 222 | + </AtomicLayoutSection> |
| 223 | + </AtomicSearchLayout> |
| 224 | + </AtomicSearchInterface> |
242 | 225 | ); |
243 | 226 | }; |
244 | 227 |
|
|
0 commit comments