You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -117,7 +117,14 @@ That corresponds to the code and file structure in the following way:
117
117
118
118
**src/app-search**
119
119
120
-
This holds the `AppSearchDriver`, the `URLManager`, and `AppSearchProvider`
120
+
Everything in this directory for now should be thought of as a separate library.
121
+
The goal eventually is to actually separate this out into a library of its own,
122
+
so when composing a UI you'd simply need to focus on creating components
123
+
from actions and state, and not all of the plumbing that goes into managing
124
+
that state. For now though, it's included in this reference as a pattern
125
+
that can be followed.
126
+
127
+
This holds the `SearchDriver`, the `URLManager`, and `SearchProvider`
121
128
from the diagram above. This is where all of the core application logic lives.
122
129
The interface to all of this logic is a set of "actions" and "state" that are
123
130
passed down in a React [Context](https://reactjs.org/docs/context.html). Those
@@ -158,13 +165,6 @@ So, for instance, a `SearchBox` component might be wired up to call the
158
165
value. A `Results` component could then simply iterate through the `results`
159
166
from state to render search results.
160
167
161
-
Everything in this directory for now should be thought of as a separate library.
162
-
The goal eventually is to actually separate this out into a library of it's own,
163
-
so when composing a UI you'd simply need to focus on creating components
164
-
from actions and state, and not all of the plumbing that goes into managing
165
-
that state. For now though, it's included in this reference as a pattern
166
-
that can be followed.
167
-
168
168
**src/containers**
169
169
170
170
Components in this UI are separated into "Containers" and "Components". These
@@ -195,16 +195,28 @@ It should be feasible to use this project as a starting point for your
195
195
own implementation. Here are a few places to look to make changes:
196
196
197
197
- The styles for the entire project can be found in [src/styles](src/styles).
198
-
Simple style tweaks changes can be made here, or you could replace these styles
199
-
with your own.
198
+
Simple style tweaks can be made here, or you could replace these styles
199
+
entirely with your own.
200
200
-[src/components](src/components) contains the view templates for
201
201
components. Structural HTML changes can be made here.
202
202
- If you find that you have different data or behavior requirements for
203
203
existing components, you can customize the component Containers in
204
204
[src/containers](src/containers).
205
205
- If you find you have requirements that none of the existing components
206
206
satisfy, you could create an entirely new component and/or container. Use the
207
-
`withAppSearch` HOC in order to access any action or state.
207
+
[withSearch.js](src/search-lib/withSearch.js) HOC in order to access any action or state.
208
+
- The SearchDriver can be configured directly in [App.js](src/App.js) to do things like:
209
+
210
+
- Optimize your API calls
211
+
- Add additional facets and customize facet behavior
212
+
- Disable URL State management
213
+
214
+
A full list of configuration options can be found in [SearchDriver.js](src/search-lib/SearchDriver.js)
215
+
216
+
- Eject from 'configuration'. You may choose to to delete the entire [src/config](src/config) directory, which holds the configuration logic that makes this a
217
+
generic UI. If you're using this as your own, production application, you likely
218
+
won't need this.
219
+
208
220
- Lastly, if you find there is a core action or state missing, you may
209
221
consider updating the core logic in [src/app-search](src/app-search).
0 commit comments