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

feat: show vote percentages #5440

Merged
merged 24 commits into from Dec 22, 2022
Merged

Conversation

jeeanribeiro
Copy link
Contributor

Summary

Change the hasVoted state if the proposal has been voted by the selected account or not

Changelog

- Adds isVotingForProposal function
- Refactors isVotingForSelectedProposalFunction
- Removes 'hasVoted' prop from the Proposal interface
- Adds the necessary logic to display if the proposal has really been voted

Relevant Issues

closes #5429

Testing

Platforms

  • Desktop
    • MacOS
    • Linux
    • Windows
  • Mobile
    • iOS
    • Android

Checklist

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or modified tests that prove my changes work as intended
  • I have verified that new and existing unit tests pass locally with my changes
  • I have verified that my latest changes pass CI workflows for testing and linting
  • I have made corresponding changes to the documentation

@jeeanribeiro jeeanribeiro added type:feature Adding a new feature or functionality context:governance stardust Related to the Stardust Protocol labels Dec 17, 2022
@jeeanribeiro jeeanribeiro self-assigned this Dec 17, 2022
@jeeanribeiro jeeanribeiro linked an issue Dec 17, 2022 that may be closed by this pull request
3 tasks
@Tuditi Tuditi marked this pull request as draft December 19, 2022 08:41
@Tuditi
Copy link
Contributor

Tuditi commented Dec 19, 2022

I moved this to draft, since this feature should also include the actual votes that have been voted for.

image

@jeeanribeiro jeeanribeiro marked this pull request as ready for review December 19, 2022 20:46
Copy link
Contributor

@maxwellmattryan maxwellmattryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just requested a few minor changes 👍

Copy link
Contributor

@Tuditi Tuditi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Tuditi Tuditi marked this pull request as draft December 20, 2022 14:59
@Tuditi Tuditi self-requested a review December 20, 2022 15:23
Copy link
Contributor

@Tuditi Tuditi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one minor change though:

Some changes required:

  1. Percentages should be of a color gray-700
  2. There should be placeholder for a tooltip icon and the percentage should always be left of that.
    image

packages/shared/components/ProposalQuestion.svelte Outdated Show resolved Hide resolved
packages/shared/components/ProposalQuestion.svelte Outdated Show resolved Hide resolved
@jeeanribeiro jeeanribeiro changed the title feat: show votes if already voted feat: show vote percentages Dec 22, 2022
@jeeanribeiro jeeanribeiro marked this pull request as ready for review December 22, 2022 13:33
Copy link
Contributor

@Tuditi Tuditi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make it so that the percentage is always aligned?
image

Copy link
Contributor

@Tuditi Tuditi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🔥

@Tuditi Tuditi merged commit 73030a6 into stardust-develop Dec 22, 2022
@Tuditi Tuditi deleted the feat/show-votes-if-already-voted branch December 22, 2022 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context:governance stardust Related to the Stardust Protocol type:feature Adding a new feature or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Show vote percentages
3 participants