Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
Fixes linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
emmdim committed Nov 29, 2023
1 parent d5238c5 commit 48eb975
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions components/blocks/question-results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const QuestionResults = (props: QuestionsResultsProps) => {
(status === ElectionStatus.ENDED || status === ElectionStatus.RESULTS || liveResults) &&
props.results !== undefined;

const decimals = (election.meta as any)?.token?.decimals || 0
const decimals = (election.meta as any)?.token?.decimals || 0;

Check warning on line 77 in components/blocks/question-results.tsx

View workflow job for this annotation

GitHub Actions / node-tests-and-build

Unexpected any. Specify a different type

Check warning on line 77 in components/blocks/question-results.tsx

View workflow job for this annotation

GitHub Actions / node-tests-and-build

Unexpected any. Specify a different type
return (
<Card isMobile={isMobile}>
{/* TITLE */}
Expand Down Expand Up @@ -127,7 +127,9 @@ export const QuestionResults = (props: QuestionsResultsProps) => {
</Text>
<Text size="sm" color="dark-gray" weight="regular">
<BreakWord>
{i18n.t('vote.vote_count', { count: getResults(choice.votes, decimals).toString() as never })}
{i18n.t('vote.vote_count', {
count: getResults(choice.votes, decimals).toString() as never,
})}
</BreakWord>
</Text>
</Col>
Expand All @@ -149,7 +151,9 @@ export const QuestionResults = (props: QuestionsResultsProps) => {
<Col>
<Text size="sm" color="dark-gray" weight="regular">
<BreakWord>
{i18n.t('vote.vote_count', { count: getResults(choice.votes, decimals).toString() as never })}
{i18n.t('vote.vote_count', {
count: getResults(choice.votes, decimals).toString() as never,
})}
</BreakWord>
</Text>
</Col>
Expand All @@ -176,7 +180,7 @@ export const QuestionResults = (props: QuestionsResultsProps) => {
);
};
const getResults = (result: BigNumber, decimals?: number) =>
decimals ? parseInt(formatUnits(result, decimals), 10) : result
decimals ? parseInt(formatUnits(result, decimals), 10) : result;
const getBarPercent = (votes: BigNumber, totalVotes: BigNumber): number => {
if (votes.eq(0)) {
return 1.5;
Expand Down

0 comments on commit 48eb975

Please sign in to comment.