protontypes / climate-triage

Find your impactful open source contribution to climate technology and sustainability.
https://climatetriage.com
MIT License
32 stars 4 forks source link

Sort projects based on download numbers #22

Closed Ly0n closed 8 months ago

Ly0n commented 8 months ago

Users might be interested to contribute to projects with high downloads numbers. We could replace this option with 'By Least Stars' sorting.

andrew commented 8 months ago

I've added a monthly_downloads fields to the api in ost that can be used for this: https://github.com/ecosyste-ms/ost/commit/7cc53d1af16abcb22c1e0dc7735e8fbfad3ddc03

Isaac-alencar commented 8 months ago

If it's ready to work on, I would love to contribute!

andrew commented 8 months ago

@Isaac-alencar yes it's ready to work on, i believe the majority of the sorting code is over here: https://github.com/protontypes/climate-triage/blob/main/context/AppDataContext.tsx#L77-L111

Isaac-alencar commented 8 months ago

Awesome, thanks! I just checked the codebase, I can implement this feature, but I'll need the data.json file which I believe was not pushed to this repository

andrew commented 8 months ago

@Isaac-alencar I'm not super familiar with that section (paging @Codeshark-NET) but looks like https://github.com/protontypes/climate-triage/blob/main/data/index.ts#L89 can generate it with pnpm prebuild

Codeshark-NET commented 8 months ago

Hey @Isaac-alencar! Great to have you. 🙌

Yes it's ready - and for now you can just replace the "least stars" sorting with this. You have the data file locally once you use pnpm prebuild, it's just not being tracked in the repo. 👍

Ideally we'd change the "sorting buttons" into being stateful; i.e. "ascending, descending, none", but that can be next on the list