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 approval workflow #15

Merged
merged 7 commits into from
Nov 7, 2024
Merged

add approval workflow #15

merged 7 commits into from
Nov 7, 2024

Conversation

rccsousa
Copy link
Collaborator

@rccsousa rccsousa commented Nov 6, 2024

Why

Wordle3 requires the player's approval to spend WDT tokens on his/her behalf. This approval workflow requires a UI to function properly.

The workflow should:

  1. if the user has enough credits and can play; (TBA);
  2. if the user has already played today; (TBA);
  3. if the user has approved Wordle3 to spend WDT on his/her behalf;

How

This PR adds the workflow to number 3, by implementing a basic modal UI with "approve/reject" to approve transactions, processes them and then instanciates a new game.

Demo

  • Modal appears if approval has not been granted:
    image

  • Success message and new game instance:
    image

// handle eligibility check
// seting up transaction approval workflow

const [cc, setCc] = useState('')
Copy link
Member

@DavideSilva DavideSilva Nov 6, 2024

Choose a reason for hiding this comment

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

This is nitpicky but I would recommend renaming this variable to something more explicit. What does cc stand for? From the context it seems it's a message you are displaying to the user, mostly for error cases, but it's not obvious from its naming

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not nitpicky at all! That variable was just a placeholder to view the workflow and will disappear, it's just a test variable.
Should've commented it properly to mention precisely that, my bad

Copy link
Member

@DavideSilva DavideSilva left a comment

Choose a reason for hiding this comment

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

Check the comment. You can change it on a later PR if you want

@rccsousa rccsousa merged commit 4225686 into main Nov 7, 2024
2 checks passed
@rccsousa rccsousa deleted the rs/add-approval-workflow branch November 7, 2024 08:35
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.

2 participants