feat: Add search input to collection and home (#1149)

* feat: Add search input to collection and home

* Tweak spacing

* Add input to drafts/starred too
This commit is contained in:
Tom Moor
2020-01-09 19:14:34 -08:00
committed by GitHub
parent 0ccbc6126b
commit cd3035a692
9 changed files with 150 additions and 12 deletions

View File

@ -64,9 +64,14 @@ export function newDocumentUrl(
return route;
}
export function searchUrl(query?: string): string {
if (query) return `/search/${encodeURIComponent(query)}`;
return `/search`;
export function searchUrl(query?: string, collectionId?: string): string {
let route = '/search';
if (query) route += `/${encodeURIComponent(query)}`;
if (collectionId) {
route += `?collectionId=${collectionId}`;
}
return route;
}
export function notFoundUrl(): string {