Skip to content

Commit

Permalink
chore: fix submission details accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras committed Sep 24, 2020
1 parent 5d205ad commit 56dafcc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 29 deletions.
3 changes: 2 additions & 1 deletion README.md
@@ -1,4 +1,4 @@
## (2020-09-23)
## (2020-09-24)

- chore: add code of conduct ([6859555](https://github.com/Proof-Of-Humanity/proof-of-humanity-web/commit/6859555))
- chore: add issue templates ([6adcbee](https://github.com/Proof-Of-Humanity/proof-of-humanity-web/commit/6adcbee))
Expand All @@ -17,6 +17,7 @@
- chore: fix ci and add security policy ([07dcc94](https://github.com/Proof-Of-Humanity/proof-of-humanity-web/commit/07dcc94))
- chore: fix routing bugs and finish registration form ([d789c7b](https://github.com/Proof-Of-Humanity/proof-of-humanity-web/commit/d789c7b))
- chore: fix subgraph memory access ([ba9cc9e](https://github.com/Proof-Of-Humanity/proof-of-humanity-web/commit/ba9cc9e))
- chore: fix weird Web3 inconsistency ([5d205ad](https://github.com/Proof-Of-Humanity/proof-of-humanity-web/commit/5d205ad))
- chore: forward all props to svg in icons ([7507ab6](https://github.com/Proof-Of-Humanity/proof-of-humanity-web/commit/7507ab6))
- chore: framework work ([b7b7e62](https://github.com/Proof-Of-Humanity/proof-of-humanity-web/commit/b7b7e62))
- chore: implement accordions ([c8e1d07](https://github.com/Proof-Of-Humanity/proof-of-humanity-web/commit/c8e1d07))
Expand Down
62 changes: 34 additions & 28 deletions _pages/profile/[id]/submission-details-accordion.js
Expand Up @@ -68,11 +68,13 @@ export default function SubmissionDetailsAccordion({ submission, contract }) {
],
id,
} = useFragment(submissionDetailsAccordionFragments.submission, submission);
const challenges = _challenges.map((challenge) => ({
...challenge,
reason: challengeReasonEnum.parse(challenge.reason),
parties: [requester, challenge.challenger],
}));
const challenges = _challenges
.map((challenge) => ({
...challenge,
reason: challengeReasonEnum.parse(challenge.reason),
parties: [requester, challenge.challenger],
}))
.filter(({ disputeID }) => disputeID !== null);
const {
sharedStakeMultiplier,
winnerStakeMultiplier,
Expand All @@ -92,31 +94,35 @@ export default function SubmissionDetailsAccordion({ submission, contract }) {
/>
}
/>
<SubmissionDetailsAccordionItem
heading="Appeal"
panel={
<Appeal
challenges={challenges}
sharedStakeMultiplier={sharedStakeMultiplier}
winnerStakeMultiplier={winnerStakeMultiplier}
loserStakeMultiplier={loserStakeMultiplier}
arbitrator={arbitrator}
arbitratorExtraData={arbitratorExtraData}
contract="proofOfHumanity"
args={[id]}
{challenges.length > 0 && (
<>
<SubmissionDetailsAccordionItem
heading="Appeal"
panel={
<Appeal
challenges={challenges}
sharedStakeMultiplier={sharedStakeMultiplier}
winnerStakeMultiplier={winnerStakeMultiplier}
loserStakeMultiplier={loserStakeMultiplier}
arbitrator={arbitrator}
arbitratorExtraData={arbitratorExtraData}
contract="proofOfHumanity"
args={[id]}
/>
}
/>
}
/>
<SubmissionDetailsAccordionItem
heading="Voting History"
panel={
<VotingHistory
challenges={challenges}
arbitrable={web3.contracts?.proofOfHumanity?.options?.address}
arbitrator={arbitrator}
<SubmissionDetailsAccordionItem
heading="Voting History"
panel={
<VotingHistory
challenges={challenges}
arbitrable={web3.contracts?.proofOfHumanity?.options?.address}
arbitrator={arbitrator}
/>
}
/>
}
/>
</>
)}
</Accordion>
);
}

1 comment on commit 56dafcc

@vercel
Copy link

@vercel vercel bot commented on 56dafcc Sep 24, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.