-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New design for direct delegation (#46)
* Get current direct delegatee * fix: load voting power correctly and fetch delegatee * fix: get delegatee * loading + case with no delegatee * refactor * add comment * add fetch direct delegation * feat: new design for direct delegation * fix: optimistic vote - build fix * fix: refuse * style fix
- Loading branch information
Showing
14 changed files
with
314 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Button } from "@/components/Button"; | ||
import { useOpenDialog } from "@/components/Dialogs/DialogProvider/DialogProvider"; | ||
import { DelegateChunk } from "../DelegateCardList/DelegateCardList"; | ||
import { Delegatees } from "@prisma/client"; | ||
|
||
type Props = { | ||
full: boolean; | ||
delegate: DelegateChunk; | ||
fetchBalanceForDirectDelegation: ( | ||
addressOrENSName: string | ||
) => Promise<string>; | ||
fetchDirectDelegatee: (addressOrENSName: string) => Promise<Delegatees>; | ||
}; | ||
export function DelegateButton({ | ||
full, | ||
delegate, | ||
fetchBalanceForDirectDelegation, | ||
fetchDirectDelegatee, | ||
}: Props) { | ||
const openDialog = useOpenDialog(); | ||
|
||
return ( | ||
<Button | ||
onClick={(e: any) => { | ||
e.preventDefault(); | ||
openDialog({ | ||
type: "DELEGATE", | ||
params: { | ||
delegate, | ||
fetchBalanceForDirectDelegation, | ||
fetchDirectDelegatee, | ||
}, | ||
}); | ||
}} | ||
className={full ? "w-full" : undefined} | ||
> | ||
Delegate | ||
</Button> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.