MOVACT / voteswiper-web

VoteSwiper helps citizens to find a political party that matches their own views in a playful way.
https://www.voteswiper.org
Other
21 stars 2 forks source link

Contributing to the Project #33

Closed SlowMoschen closed 3 months ago

SlowMoschen commented 3 months ago

Hey there, I looked through the current open issues and wanted to help. If you like I can work on the following Issues.


Issue #25 and #30 can be fixed by editing only one file (./components/swiper/screen-result/index.tsx)


Feature #31

A QR code for an easier bank transfer can be quickly made with the following tool: https://www.qrcode-generator.de/solutions/epc-qr-code/

I would put the QR code right under bank credentials you already have. This means the user can decide for themselves which option they want to make a donation


Fix for #25

The current implementation for the result percentage looks like this:

<span>
{Intl.NumberFormat(locale).format(
parseFloat(score.percentage.toFixed(1))
)}
%
</span>

But if a user skips all questions, the score.percentage is NULL.

So my suggestion to fix this problem would be to check if the value is a number by calling the isNaN() with a bang operator in front.

<span>
{
!isNaN(score.percentage) && Intl.NumberFormat(locale).format(
parseFloat(score.percentage.toFixed(1))
)
}
%
</span>

Fix for #30

As the Issues suggests when clicking on the "Spendenseite" anchor tag the page links directly to the corresponding page. This discards the result.

This can easily be fixed with adding the target attribute with _blank on the anchor tag


mxmtsk commented 3 months ago

We appreciate the help, so I'd be happy to review PRs fixing these issues!

For #25 I think it would be cooler to skip the result bars all together and show a specific message a la

"You skipped all questions. Edit your answers to get a result. [Link to edit answers]"

SlowMoschen commented 3 months ago

Superb, I will begin my work on the PR as soon as I am home.

mxmtsk commented 3 months ago

Will close this since you opened a PR at #34