From fec4449afddd320cd22018cc6c2411f2ae7f674a Mon Sep 17 00:00:00 2001 From: David Vargas Date: Mon, 14 Mar 2022 19:04:15 -0600 Subject: [PATCH] Improveing default filters --- package-lock.json | 6 +-- package.json | 2 +- src/components/ResultsView.tsx | 70 +++++++++++++++++----------------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 554c125e..38ed2263 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6585,9 +6585,9 @@ } }, "roamjs-components": { - "version": "0.52.6", - "resolved": "https://registry.npmjs.org/roamjs-components/-/roamjs-components-0.52.6.tgz", - "integrity": "sha512-eIl8nNYZyy1jGnlr5NAa/tJK8fXLRAlY0j9/zzyv69AFCv4NhMoespxPeR7tBYo0krbm9uWtklZku7ZgK/Yuyg==", + "version": "0.52.8", + "resolved": "https://registry.npmjs.org/roamjs-components/-/roamjs-components-0.52.8.tgz", + "integrity": "sha512-hxa+hVNLf+Twcga87ZdixgXM70TDxPCTL4iWuh9minrHd1N1DFaF6s8emJHv4+teDCR/bfdcedyH5+AAIoqD3g==", "requires": { "@blueprintjs/core": "^3.52.0", "@blueprintjs/datetime": "^3.23.5", diff --git a/package.json b/package.json index 0e499247..aecb296d 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,6 @@ "dependencies": { "react": "^17.0.2", "react-dom": "^17.0.2", - "roamjs-components": "^0.52.6" + "roamjs-components": "^0.52.8" } } diff --git a/src/components/ResultsView.tsx b/src/components/ResultsView.tsx index acebf9f9..393cc87b 100644 --- a/src/components/ResultsView.tsx +++ b/src/components/ResultsView.tsx @@ -63,6 +63,7 @@ const ResultHeader = ({ setActiveSort, filters, setFilters, + initialFilter, }: { c: string; results: Result[]; @@ -70,6 +71,7 @@ const ResultHeader = ({ setActiveSort: (s: Sorts) => void; filters: Filters; setFilters: (f: Filters) => void; + initialFilter: Filters[string]; }) => { const filterData = useMemo( () => ({ @@ -121,6 +123,7 @@ const ResultHeader = ({ )} setFilters({ ...filters, [c]: newFilters }) } @@ -506,42 +509,39 @@ const ResultsView = ({ /> - {sortedResults.length ? ( - - - - {columns.map((c) => ( - - ))} - - - - {sortedResults.map((r) => ( - + + + + {columns.map((c) => ( + ))} - - - ) : ( -
No Results
- )} + + + + {sortedResults.map((r) => ( + + ))} + +
);