protect-earth / protect.earth

International Directory of Climate Action for Humans, Businesses, and anyone else.
https://protect.earth
MIT License
35 stars 15 forks source link

Country Selector #28

Open philsturgeon opened 4 years ago

philsturgeon commented 4 years ago

The goal of the selector is to help elevator relevant content to you, so somebody in Serbia should be able to see any content which is in Serbia, as well as globally available content.

Country selection for now will have nothing to do with translations or localization, we'll deal with that in #14 later.

A selector like this would be awesome:

image

All categories should be available to people, even if there are no suggestions in that category.

All tags should be available to people, even if there are no suggestions in that tag.

We could show a message like "There are currently no available actions in your country, but click here to see some more ideas." and it expands a global list, We don't want people to be unable to find things, we just want it to be relevant to them if possible.

Squallac commented 4 years ago

I'll work on this

philsturgeon commented 4 years ago

@Squallac excellent, thank you.

Squallac commented 4 years ago

@philsturgeon Do we have a specific list of countries that you want to show? Or I'll just list all of them

philsturgeon commented 4 years ago

All the ones we have content for. It can be done manually, but bonus points if it can be automated.

philsturgeon commented 4 years ago

I took a swing at fixing the country selector in v1 (b0314ab) because v2 stalled out, but I cannot seem to get the selection to persist between page loads because I do not understand React context. If anyone can get it working in main real quick then we can have this handy feature alive until v2 comes along.

To try it out, uncomment the selector in the footer, and refresh after selecting. Currently the country you selected will vanish on refresh or clicking to another page.

If you get persistence working, when you go to a category you should only see links for the country or global content.

piperchester commented 3 years ago

I took a swing at fixing the country selector in v1 (b0314ab) because v2 stalled out, but I cannot seem to get the selection to persist between page loads because I do not understand React context. If anyone can get it working in main real quick then we can have this handy feature alive until v2 comes along.

To try it out, uncomment the selector in the footer, and refresh after selecting. Currently the country you selected will vanish on refresh or clicking to another page.

If you get persistence working, when you go to a category you should only see links for the country or global content.

I'll start exploring this. Was considering persisting some state in session storage or a cookie, if no one has any objections.

philsturgeon commented 3 years ago

Sounds good!

On Tue, Oct 20, 2020 at 16:32, Piper notifications@github.com wrote:

I took a swing at fixing the country selector in v1 (b0314ab) because v2 stalled out, but I cannot seem to get the selection to persist between page loads because I do not understand React context. If anyone can get it working in main real quick then we can have this handy feature alive until v2 comes along.

To try it out, uncomment the selector in the footer, and refresh after selecting. Currently the country you selected will vanish on refresh or clicking to another page.

If you get persistence working, when you go to a category you should only see links for the country or global content.

I'll start exploring this. Was considering persisting some state in session storage or a cookie, if no one has any objections.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.