sledilnik / zdravniki

Website for showing doctors' availability in Slovenia - https://zdravniki.sledilnik.org/
https://zdravniki.sledilnik.org
8 stars 8 forks source link

Feat jalezi/sozial marie banner 466 #474

Closed jalezi closed 5 months ago

jalezi commented 6 months ago

Adds popup for SozialMarie voting. Users can decide whether a popup will show on the initial load. They can trigger a popup by clicking on a button in the header. The trigger button has a tooltip showing remaining time to voting, remaining time to vote or whether the voting has ended.

Trigger button: Screenshot 2024-03-14 at 10 23 24

Styling is not done. Open for recommendations. I prepared two components to show the timer in the popup.

Simple: Screenshot 2024-03-14 at 10 06 40

Full: Screenshot 2024-03-14 at 10 08 59

I prefer the simple version.

After voting has expired this will show up: Screenshot 2024-03-14 at 10 10 26

Todo:

FIX: #466

jalezi commented 6 months ago

he, he found the first bug. Don't show does not work as expected.

stefanb commented 6 months ago

It is also probably not wise to show the popup before voting, because at most people will click "don't show it again" so they won't be reminded when they could actually cast their vote.

stefanb commented 6 months ago

Alternatively the text should be "Don't show this again until the voting starts", so that the users are reminded again when they can vote and then they can silence the popup for good.

jalezi commented 6 months ago

Is there a specific process.env var for deploy-preview? Something like in dev mode.

const isDev === process.env.NODE_ENV === "development"
jalezi commented 6 months ago

Hm, safari, does not recognize new Date("2024-04-09 GMT+0200"). gives an INVALID_DATE.

https://sagrawal003.medium.com/javascripts-date-does-not-work-with-ie-safari-technolize-your-future-c49c09dc4d87