WIP, live site here
Content:
- Fetching data
- Server side prop fetching and rendering
- Filtering by search
- Toggling favourites
- Filtering by favourites
- Localstorage persistence
- Pagination
- Vercel CD
- Viewing individual coin details, each on its own dynamic route
- 7d price charts
- Responsive design
Definitely should use a graphing library for the price graphs, instead of mapping 168 svg containing divs for each data point and drawing svg lines between them; was curious though if I could hack it togetherdoneFigure out how to make charts inherit fonts upon loadingdonedoneAutomatic price updating every X minutesdoneMobile/responsive designdoneDisable pagination or something when viewing favourites, or move those to a separate tab/page all togetherdoneAdd the table head and thingiesdoneI should probably switch to contextdoneContext doesn't seem to be working nicely when there are multiple state updates at the same time, maybe I should try Reduxnvm it seems to be the api that is slowLocalstorage persistencedoneIndividual coin info, each on its own dynamic routedone- Lotsa styling, + themes
- 🤔
const [favorites, setFavorites] = useState<string[]>(
(typeof window !== "undefined" &&
JSON.parse(localStorage.getItem("favourites") || "[]")) ||
[]
);
//Checks if code is being run on server or client by checking typeof window, needs to be in quotation for some reason, if "undefined", means server, short-circuits, goes to fallback "[]", if not, gets localstorage key, which returns null if it doesn't exist, again falling back to "[]"