Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initialLocations in Research page in order to filter the initial posts #880

Merged
merged 5 commits into from
Nov 27, 2023

Conversation

orestisathanasopoulos
Copy link
Contributor

resolve #825

Add initialLocations in Research page in order to filter the posts shown by default

This solution filters the initial posts by initialising the filteredLocations state with the const InitialLocations in order to use the same filters as the home page.

I only used the function extractCountryIdFromPathname used in the useCountryId hook to extract the country id and not the entire hook since it's not possible to call a hook inside another hook.

For the U.S. the filtered locations include the general United States tag and all individual states tags since all state related posts also include the general tag.

(On a slightly unrelated note, I'm not the most experienced developer and I haven't been contributing to open source for a very long time, so please feel free to let me know if my PRs are not following best practices or to provide feedback on my code if necessary)

@MaxGhenis
Copy link
Contributor

Thank you @orestisathanasopoulos! I've requested others with more knowledge of the codebase to review this. Really appreciate it.

We have a couple other PRs that should help get past the CI issues more automatically, though for now could you run prettier to format the code?

@orestisathanasopoulos
Copy link
Contributor Author

Thanks @MaxGhenis! I ran prettier which seems to have fixed the issue in Research.jsx but has also created a conflict in the markdown file that I didn't modify

@nikhilwoodruff
Copy link
Contributor

Thanks @orestisathanasopoulos! Tested locally and works exactly as expected.

@nikhilwoodruff
Copy link
Contributor

(also fixed the merge conflict)

@nikhilwoodruff nikhilwoodruff merged commit b62413a into PolicyEngine:master Nov 27, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filter research to selected country by default
3 participants