-
Notifications
You must be signed in to change notification settings - Fork 1
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/api mock #17
Feat/api mock #17
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
app/(routes)/page.tsx
Outdated
@@ -26,10 +27,10 @@ const Page = () => { | |||
Mento | |||
</div> | |||
<div className="hidden gap-x1 md:flex"> | |||
<Button theme="clear" href="/create-proposal"> | |||
<Button theme="clear" href="/create-proposal" disabled={!walletAddress}> |
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.
Tutaj wydaje mi się, że disabled nie będzie potrzebny, bo pierwszy step to Podłączenie do walleta gdyby nie był podłączony
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.
słusznie, usunę
for: votesResponseJson.filter((vote: IVote) => vote.type === 'for'), | ||
against: votesResponseJson.filter((vote: IVote) => vote.type === 'against'), | ||
abstain: votesResponseJson.filter((vote: IVote) => vote.type === 'abstain'), | ||
}; |
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.
Proponowałabym to dodać do wspólnej funkcji, ten kod powtzraz się w dwóch miejscach
const votesResponse = await fetch(/api/proposals/${id}/votes);
const votesResponseJson = await votesResponse.json();
const votes: ProposalVotesMap = {
for: votesResponseJson.filter((vote: IVote) => vote.type === 'for'),
against: votesResponseJson.filter((vote: IVote) => vote.type === 'against'),
abstain: votesResponseJson.filter((vote: IVote) => vote.type === 'abstain'),
};
e164ec8
to
e8f8cbf
Compare
e8f8cbf
to
63ee2e8
Compare
Added zustand store and implemented it for all api calls