Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny Chung committed Feb 24, 2022
1 parent 050cea1 commit e77ac9d
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,19 @@ export const ActionsBuilder: React.FC<ActionsBuilderProps> = ({
<Flex direction="row" justifyContent="space-between">
<CardHeader color="#fff">Actions</CardHeader>
{proposalViewMode ? null : actionsEditMode ? (
<Button variant="secondary" onClick={() => setActionsEditMode(false)}>Save</Button>
<Button
variant="secondary"
onClick={() => setActionsEditMode(false)}
>
Save
</Button>
) : (
<Button variant="secondary" onClick={() => setActionsEditMode(true)}>Edit</Button>
<Button
variant="secondary"
onClick={() => setActionsEditMode(true)}
>
Edit
</Button>
)}
</Flex>
}
Expand Down Expand Up @@ -94,7 +104,7 @@ export const ActionsBuilder: React.FC<ActionsBuilderProps> = ({
{
type: ActionTypes[
[ActionTypes.for, ActionTypes.against][
Math.ceil(Math.random() * 2) - 1
Math.ceil(Math.random() * 2) - 1
]
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export const SidebarInfoCard = () => {
<SidebarCardContent>
<Row>
<Label>Consensus System</Label>
<Label color={({ theme }) => theme.colors.proposalText.lightGrey}>Guild</Label>
<Label color={({ theme }) => theme.colors.proposalText.lightGrey}>
Guild
</Label>
</Row>
<Row>
<Label>Proposal Duration</Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ const ProposalInfoCard: React.FC = () => {

<UserInfoDetail>
<Label>Consensus System</Label>
<Label color={({ theme }) => theme.colors.proposalText.lightGrey}>Guild</Label>
<Label color={({ theme }) => theme.colors.proposalText.lightGrey}>
Guild
</Label>
</UserInfoDetail>
<UserInfoDetail>
<Label>Proposal Duration</Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ const ColoredBullet = styled.span`
margin, padding: 0;
position: absolute;
`
`;
const StyledContainer = styled(Flex)`
display: flex;
flex-direction: row;
justify-content: flex-start;
`
`;
const StyledText = styled.span`
margin-left: 1.2rem;
`
margin-left: 1.2rem;
`;

export const ProposalVotes: React.FC<ProposalVotesProps> = ({
showToken,
Expand All @@ -56,16 +56,18 @@ export const ProposalVotes: React.FC<ProposalVotesProps> = ({
args: any
): number => {
if (args[action] === null || args[action] === undefined) {
return 0
return 0;
}
return showToken ? formatUnits(args[action][action][0]) : args[action][action][1];
}
return showToken
? formatUnits(args[action][action][0])
: args[action][action][1];
};

return (
<VotesContainer>
{voteData.args &&
Object.values(voteData?.args).map((_, i) => {
console.log("voteData", voteData.args[i])
console.log('voteData', voteData.args[i]);
return (
<>
<VotesRow key={i} type="0">
Expand All @@ -76,17 +78,16 @@ export const ProposalVotes: React.FC<ProposalVotesProps> = ({
<div>
{valueToDisplay(i, showToken, voteData?.args)} {unitDisplay}
</div>

</VotesRow>
<VotesRow type="1">
<StyledContainer>
<ColoredBullet color="#E75C5C">{'\u2022'}</ColoredBullet>
<StyledText>{'Against'}</StyledText>
</StyledContainer>
<div>
{valueToDisplay(i + 1, showToken, voteData?.args)} {unitDisplay}
{valueToDisplay(i + 1, showToken, voteData?.args)}{' '}
{unitDisplay}
</div>

</VotesRow>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ const ProposalVoteCard = () => {
header={
<SidebarCardHeader>
Cast your vote{' '}
<SmallButton variant="secondary" onClick={() => setShowToken(!showToken)}>
<SmallButton
variant="secondary"
onClick={() => setShowToken(!showToken)}
>
{showToken ? TOKEN : '%'}
</SmallButton>
</SidebarCardHeader>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Guilds/common/VoteChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const VoteQuorumLabel = styled.div`
quorum < 10
? `0px ${theme.radii.curved} ${theme.radii.curved}`
: quorum > 90
? `${theme.radii.curved} 0px ${theme.radii.curved} ${theme.radii.curved}`
: `${theme.radii.curved}`};
? `${theme.radii.curved} 0px ${theme.radii.curved} ${theme.radii.curved}`
: `${theme.radii.curved}`};
font-size: 14px;
font-weight: 600;
align-items: center;
Expand All @@ -76,8 +76,8 @@ const VoteQuorumContainer = styled.div`
quorum < 10
? `${quorum}%`
: quorum > 90
? `calc(${quorum}% - 65px)`
: `calc(${quorum}% - 22px)`};
? `calc(${quorum}% - 65px)`
: `calc(${quorum}% - 22px)`};
`;

const SkeletonAction = styled(Flex)`
Expand Down

0 comments on commit e77ac9d

Please sign in to comment.