diff --git a/packages/DApp/src/components/votes/VoteChart.tsx b/packages/DApp/src/components/votes/VoteChart.tsx index 6040d56..cfa3908 100644 --- a/packages/DApp/src/components/votes/VoteChart.tsx +++ b/packages/DApp/src/components/votes/VoteChart.tsx @@ -30,16 +30,15 @@ export function VoteChart({ const votesFor = vote.voteFor.toNumber() const votesAgainst = vote.voteAgainst.toNumber() const voteSum = votesFor + votesAgainst - const graphWidth = (100 * votesAgainst) / voteSum - (votesAgainst > 0 && votesFor > 0 ? 0 : 3) + const graphWidth = (100 * votesAgainst) / voteSum let balanceWidth = graphWidth if (proposingAmount && selectedVote) { balanceWidth = selectedVote.type === 0 - ? (100 * (votesAgainst + proposingAmount)) / (voteSum + proposingAmount) - - (votesFor > 0 && votesAgainst > 0 && proposingAmount > 0 ? 0 : 3) - : (100 * votesAgainst) / (voteSum + proposingAmount) - (votesAgainst > 0 && proposingAmount > 0 ? 0 : 3) + ? (100 * (votesAgainst + proposingAmount)) / (voteSum + proposingAmount) + : (100 * votesAgainst) / (voteSum + proposingAmount) } return ( diff --git a/packages/DApp/src/components/votes/VoteGraphBar.tsx b/packages/DApp/src/components/votes/VoteGraphBar.tsx index e9651b1..7059ccb 100644 --- a/packages/DApp/src/components/votes/VoteGraphBar.tsx +++ b/packages/DApp/src/components/votes/VoteGraphBar.tsx @@ -23,8 +23,8 @@ export interface VoteGraphBarProps { } export function VoteGraphBar({ graphWidth, balanceWidth, voteWinner, isAnimation }: VoteGraphBarProps) { - const markerWidth: number = balanceWidth ? balanceWidth : 3 - const votesWidth: number = graphWidth ? graphWidth : 3 + const markerWidth: number = balanceWidth ? balanceWidth : 0 + const votesWidth: number = graphWidth ? graphWidth : 0 const [keyFrames, setKeyFrames] = useState('') const [style, setStyle] = useState({ width: `${votesWidth}%` }) @@ -53,14 +53,16 @@ const VoteGraph = styled.div` background-color: ${({ theme }) => (theme.voteWinner === 1 ? Colors.GrayDisabledLight : Colors.BlueBar)}; border-radius: 10px; padding-top: 5px; + border-left: 13px solid ${({ theme }) => (theme.voteWinner === 0 ? Colors.GrayDisabledLight : Colors.Orange)}; + border-right: 13px solid ${({ theme }) => (theme.voteWinner === 1 ? Colors.GrayDisabledLight : Colors.BlueBar)}; &::before { content: ''; width: 16px; height: 5px; position: absolute; - top: -5px; - left: calc(50% - 1px); + top: -6px; + left: calc(50% - 2px); transform: translateX(-50%); background-image: url(${indicatorIcon}); background-size: cover; @@ -81,10 +83,8 @@ const VoteGraphAgainst = styled.div` position: absolute; left: 0; top: 0; - width: 3%; height: 16px; background-color: ${({ theme }) => (theme.voteWinner === 2 ? Colors.GrayDisabledLight : Colors.Orange)}; - border-radius: 10px 0 0 10px; transition: width 2s; z-index: 2; ` @@ -93,10 +93,8 @@ const VoteBalance = styled.div` position: absolute; left: 0; top: 0; - width: 3%; height: 16px; background-color: transparent; border-right: 2px solid ${Colors.VioletLight}; - border-radius: 10px 0 0 10px; z-index: 2; `