@@ -18,6 +18,7 @@ class Search extends Component {
18 this.glossarySearch = this.glossarySearch.bind(this);
18 this.glossarySearch = this.glossarySearch.bind(this);
19 this.patpSearch = this.patpSearch.bind(this);
19 this.patpSearch = this.patpSearch.bind(this);
20 this.devSearch = this.devSearch.bind(this);
20 this.devSearch = this.devSearch.bind(this);
21+ this.opsSearch = this.opsSearch.bind(this);
23 searchEndpoint(query) {
24 searchEndpoint(query) {
@@ -32,6 +33,10 @@ class Search extends Component {
32 return `/api/glossary?q=${encodeURIComponent(query)}`;
33 return `/api/glossary?q=${encodeURIComponent(query)}`;
37+ return `/api/ops-search?q=${query}`;
35 patpSearch(query) {
40 patpSearch(query) {
37 (ob.isValidPatp(`~${deSig(query.toLowerCase())}`) &&
42 (ob.isValidPatp(`~${deSig(query.toLowerCase())}`) &&
@@ -100,11 +105,21 @@ class Search extends Component {
108+ const opsResults = await fetch(this.opsSearch(query))
109+ .then((res) => res.json())
111+ return res.results.map((item) => ({
103 const list = [
117 const list = [
104 ...glossaryResults,
118 ...glossaryResults,
105 ...patpResult,
119 ...patpResult,
106 ...results,
120 ...results,
107 ...devResults,
121 ...devResults,
110 this.setState({ results: list });
125 this.setState({ results: list });
@@ -311,6 +326,47 @@ class Search extends Component {
329+ if (item.type === "OPS_RESULT") {
330+ const opsItem = Object.assign({}, item.content);
333+ ] = `https://operators.urbit.org${item.content.slug}`;
336+ className={`cursor-pointer flex text-left w-full ${
337+ selected ? "bg-green-400" : ""
340+ key: item.content.link + "-" + index,
346+ <div className="p-3">
348+ className={`font-medium text-base ${
349+ selected ? "text-white" : "text-wall-600"
352+ <span className="text-wall-400">
353+ {item.content.parent !== "Content"
354+ ? `operators.urbit.org / ${item.content.parent} /`
355+ : "operators.urbit.org /"}{" "}
357+ {item.content.title}
360+ className={`text-base font-regular text-small ${
361+ selected ? "text-midWhite" : "text-wall-500"
364+ {item.content.content}
314 return null;
370 return null;