Closed nina-py closed 3 years ago
@kkyeboah, the tabs re-render as you go from one tab to another. The data on the page is fetched from Apollo cache, but it seems on the dev version at least that a slightly more complex query like the snoozed one gets parsed noticeably slower compared to the other three. I've checked and double-checked the code and this is the only difference.
Yes, I've deliberately kept the cards as-is. Was planning a separate PR for this & wanted to bundle mobile-friendly updates into cards as well, but can do it in this PR.
I haven't noticed the URL change but it's interesting! There shouldn't be anything there that would cause this.
The header - yes, that component needs rewriting from scratch. I've already got a branch for this and have been working on it between other things.
@nina-py that's interesting concerning data for snoozed taking longer.
I'll approve this to unblock the follow-up work.
Updated Prospects page to load data on all four tabs.
Updated Tab component to always render the chip for number of articles, but show a loading spinner while the API call is in progress so that renders and re-renders do not cause content to jump around on the page.
Updated data generation script for the local API (snoozedUntil field is now a timestamp).
Note that I haven't updated tests for the Prospects page as there is unexpected (!) trickiness around testing custom hooks. There should be ways to increase test coverage, but for now the new calls to the local API are untested. Please note that some of the data has been changed so before testing the PR locally, you need to rerun
npm run api:generate-data
script.