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

Fix/ Consensus props #80

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/consensus/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ describe('Consensus', () => {
votingPower: {
title: 'Voting Power',
value: 0.85,
display: '85 %',
},
colors: ['#FD3B4C', '#E8E8E8'],
round: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/consensus/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Consensus = (prop: Props) => {
}: any) => {
return (
<text className={classnames(classes.root)} fill="black" textAnchor="middle">
<tspan className={classnames('amountInChart')} y={cy + 3} x={cx}>85 %</tspan>
<tspan className={classnames('amountInChart')} y={cy + 3} x={cx}>{votingPower.display}</tspan>
<tspan className={classnames('inChart')} x={cx} y={cy + 26}>{`${round.title} ${round.display}`}</tspan>
<tspan className={classnames('inChart')} x={cx} y={cy + 39}>{`${step.title} ${step.display}`}</tspan>
</text>
Expand Down
5 changes: 3 additions & 2 deletions src/components/consensus/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface Props {
title: string;
height: Detail;
proposer: Proposer;
votingPower: Data;
votingPower: VotingPower;
colors: [string, string];
className?: string;
round: Detail;
Expand All @@ -21,7 +21,8 @@ export type Proposer = {
display: React.ReactNode;
}

type Data = {
type VotingPower = {
title: string;
value: number;
display: string;
}
7 changes: 5 additions & 2 deletions stories/consensus.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import {
proposer={dummyProposer}
votingPower={{
title: 'Voting Power',
value: 0.85
value: 0.85,
display: '85 %',
}}
colors={['#FD3B4C', '#E8E8E8']}
round={{
Expand Down Expand Up @@ -48,7 +49,8 @@ import {
}}
votingPower={{
title: 'Voting Power',
value: 0.85
value: 0.85,
display: '85 %'
}}
colors={['#FD3B4C', '#E8E8E8']}
round={{
Expand Down Expand Up @@ -127,6 +129,7 @@ import {
{
title: string;
value: number;
display: string;
}
```

Expand Down