Skip to content

Commit

Permalink
run lint/pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
Da-Colon committed Mar 20, 2024
1 parent c00f86a commit 98da256
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/components/Activity/ActivityDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function ActivityDescription({ activity, showFullDescription }: IActivity
alignItems="center"
color="#B3B3B3"
textStyle="text-md-sans-regular"
>
>
<Avatar
size="sm"
address={author}
Expand Down
5 changes: 4 additions & 1 deletion src/components/Activity/ActivityDescriptionGovernance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ export function ProposalTitle({ activity }: { activity: Activity }) {
color="grayscale.100"
pr={2}
>
<Flex gap={2} alignItems="center">
<Flex
gap={2}
alignItems="center"
>
<Text>{formatId((activity as GovernanceActivity).proposalId)}</Text>
{metaData.title ? <Text>{metaData.title}</Text> : null}
</Flex>
Expand Down
22 changes: 11 additions & 11 deletions src/components/ui/badges/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ const redMinus2 = '#640E0D';
const redHover = '#76110F';

const sandBG = '#C18D5A';
const sandHover = '#B97F46'
const blackText = '#150D04'
const sandHover = '#B97F46';
const blackText = '#150D04';

const grayBG = '#9A979D'
const grayHover = '#8C8990'
const grayBG = '#9A979D';
const grayHover = '#8C8990';

const lightBlueBG = '#A3B9EC'
const lightBlueHover = '#8DA8E7'
const darkBlueText = '#0A1E3D'
const lightBlueBG = '#A3B9EC';
const lightBlueHover = '#8DA8E7';
const darkBlueText = '#0A1E3D';

const darkBlueBG = '#1B3B83'
const darkBlueHover = '#17326E'
const lightBlueText = '#D1DCF5'
const darkBlueBG = '#1B3B83';
const darkBlueHover = '#17326E';
const lightBlueText = '#D1DCF5';

const BADGE_MAPPING: BadgeType = {
[FractalProposalState.ACTIVE]: {
Expand Down Expand Up @@ -115,7 +115,7 @@ const BADGE_MAPPING: BadgeType = {
textColor: darkBlueText,
_hover: { bg: lightBlueHover },
},
ownerApproved: { bg: 'sand.700', textColor: 'grayscale.black', _hover: { bg: 'sand.600' }, },
ownerApproved: { bg: 'sand.700', textColor: 'grayscale.black', _hover: { bg: 'sand.600' } },
};

type BadgeSize = { [key: string]: { minWidth: string; height: string } };
Expand Down
26 changes: 9 additions & 17 deletions src/components/ui/badges/QuorumBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function QuorumBadge({ proposal }: { proposal: FractalProposal })
return BigNumber.from(0);
}, [votesSummary]);

const erc20MeetsQuorum = useMemo(async() => {
const erc20MeetsQuorum = useMemo(async () => {
if (!ozLinearVotingContractAddress || !baseContracts || !votesToken || !votesSummary) {
return undefined;
}
Expand All @@ -45,9 +45,9 @@ export default function QuorumBadge({ proposal }: { proposal: FractalProposal })
votesSummary.yes,
votesSummary.abstain,
);
return result
return result;
}, [votesToken, votesSummary, baseContracts, ozLinearVotingContractAddress]);

// @dev only azorius governance has quorum
if ((proposal as SnapshotProposal).snapshotProposalId || !votingStrategy) {
return null;
Expand All @@ -64,24 +64,16 @@ export default function QuorumBadge({ proposal }: { proposal: FractalProposal })
: null;

const strategyQuorum =
erc721Tokens !== undefined
? votingStrategy.quorumThreshold!.value.toNumber()
: 1;
erc721Tokens !== undefined ? votingStrategy.quorumThreshold!.value.toNumber() : 1;
const reachedQuorum =
erc721Tokens !== undefined
? totalVotesCasted.sub(votesSummary.no).toString()
: '0';
const totalQuorum =
erc721Tokens !== undefined
? strategyQuorum.toString()
: 0;
erc721Tokens !== undefined ? totalVotesCasted.sub(votesSummary.no).toString() : '0';
const totalQuorum = erc721Tokens !== undefined ? strategyQuorum.toString() : 0;

const meetsQuorum = erc20MeetsQuorum !== undefined ? erc20MeetsQuorum : reachedQuorum >= totalQuorum;
const meetsQuorum =
erc20MeetsQuorum !== undefined ? erc20MeetsQuorum : reachedQuorum >= totalQuorum;

const displayColor =
!totalVotesCasted.isZero() && meetsQuorum
? quorumReachedColor
: quorumNotReachedColor;
!totalVotesCasted.isZero() && meetsQuorum ? quorumReachedColor : quorumNotReachedColor;
return (
<>
<Box
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/proposal/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface IMarkdown {
content: string;
}

export default function Markdown({ truncate, content, collapsedLines = 6}: IMarkdown) {
export default function Markdown({ truncate, content, collapsedLines = 6 }: IMarkdown) {
const { t } = useTranslation('common');
const [collapsed, setCollapsed] = useState(true);
const [totalLines, setTotalLines] = useState(0);
Expand Down

0 comments on commit 98da256

Please sign in to comment.