kokarn / tarkov-tools

https://tarkov-tools.com
MIT License
70 stars 44 forks source link

update data-table to persist sort order into localStorage #96

Closed khamer closed 3 years ago

khamer commented 3 years ago

Meant to address #95 for Hacktoberfest - this uses useStateWithLocalStorage within data-table/index.js to store and retrieve the sort order for a table to local storage.

I'm not 100% happy with the implementation here, as I'd like to use something better for storageKey - I see that barters-table for example has a key attribute on <DataTable> but I'm probably too new to react (I mostly use Vue) to understand why I can't seem to retrieve that value to use for the storageKey. I'll happily make some tweaks if you've got suggestions.

Happy Hacktoberfest!

netlify[bot] commented 3 years ago

✔️ Deploy Preview for tarkov-tools-preview ready!

🔨 Explore the source changes: 2c8957999475823770d5c60b2803000f2090f9d8

🔍 Inspect the deploy log: https://app.netlify.com/sites/tarkov-tools-preview/deploys/61671f5f7cba4c00088abe45

😎 Browse the preview: https://deploy-preview-96--tarkov-tools-preview.netlify.app/

kokarn commented 3 years ago

This looks amazing! Thanks so much for looking into this <3

khamer commented 3 years ago

Hey @kokarn - if you don't mind adding the hacktoberfest-accepted label to this PR, I would be much obliged.

kokarn commented 3 years ago

For sure my dude! :)