-
Notifications
You must be signed in to change notification settings - Fork 212
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
Voting new styles for 0.8 #935
Conversation
Clicking on the link can be confusing with wanting to actually open the card itself, rather than the link.
@@ -39,16 +38,24 @@ const VoteActions = React.memo(({ vote, onVoteYes, onVoteNo, onExecute }) => { | |||
const hasVoted = [VOTE_YEA, VOTE_NAY].includes(connectedAccountVote) | |||
|
|||
useEffect(() => { | |||
let cancelled = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, for this you could've used the usePromise
hook that the inner functions rely on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yes, but usePromise()
's API is based on returning the resulting value from the promise (so you can use it) whereas we just want to cancel it here and avoid a side effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pseudo code here (this is what I was thinking):
const promise = Promise.all([canUserVotePromise, canExecutePromise, userBalancePromise])
const value = usePromise(promise, false)
setReady(value)
But yeah, there are other things that might need to be worked on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm worried there might be funny things with how the state gets updated / triggered (compared to now, which is relatively obvious what happens on cancellation / updates), and to be honest usePromise()
is something we should find a better abstraction for since it's kind of clunky.
Fixes #714.
How to test
Either ask the author if the latest changes have been deployed to
preview.aragon.org
or
Assuming everything is in the
~/projects
directory (replace by your own).First time
Clone this repo + Aragon client’s + aragonUI’s if not done already:
Create a link for aragonUI (npm might tell you that it is already done):
Getting updates
Here we are updating the branches + reinstalling the dependencies + linking aragonUI again.
Running it
We can now start the two servers (the app + Aragon client). In one shell session (or tab in your terminal app):
In another session (we are asking the client to load apps running locally):
Open http://localhost:3000/ in your browser.