Skip to content

Commit

Permalink
badge fix on donation card and alt card
Browse files Browse the repository at this point in the history
  • Loading branch information
mateodaza committed Oct 3, 2024
1 parent ec44675 commit 47f272a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
24 changes: 12 additions & 12 deletions src/components/project-card/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const ProjectCard = (props: IProjectCard) => {

const { activeStartedRound, activeQFRound } = getActiveRound(qfRounds);
const hasFooter = activeStartedRound || verified || isGivbackEligible;

const showVerifiedBadge = verified || isGivbackEligible;
const {
allocatedFundUSDPreferred,
allocatedFundUSD,
Expand Down Expand Up @@ -341,17 +341,7 @@ const ProjectCard = (props: IProjectCard) => {
<Hr />
<PaddedRow $justifyContent='space-between'>
<Flex gap='16px'>
{isGivbackEligible && (
<Flex $alignItems='center' gap='4px'>
<IconGIVBack16
color={brandColors.giv[500]}
/>
<GivbackEligibleText>
GIVbacks
</GivbackEligibleText>
</Flex>
)}
{verified && (
{showVerifiedBadge && (
<Flex $alignItems='center' gap='4px'>
<IconVerifiedBadge16
color={semanticColors.jade[500]}
Expand All @@ -363,6 +353,16 @@ const ProjectCard = (props: IProjectCard) => {
</VerifiedText>
</Flex>
)}
{isGivbackEligible && (
<Flex $alignItems='center' gap='4px'>
<IconGIVBack16
color={brandColors.giv[500]}
/>
<GivbackEligibleText>
GIVbacks
</GivbackEligibleText>
</Flex>
)}
{activeStartedRound && (
<QFBadge>
{activeStartedRound?.name}
Expand Down
7 changes: 5 additions & 2 deletions src/components/project-card/ProjectCardAlt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const ProjectCard = (props: IProjectCard) => {
description,
image,
verified,
isGivbackEligible,
adminUser,
slug,
organization,
Expand All @@ -44,7 +45,7 @@ const ProjectCard = (props: IProjectCard) => {
adminUser?.walletAddress,
adminUser?.avatar,
);

const showVerifiedBadge = verified || isGivbackEligible;
return (
<Wrapper $isNew={isNew}>
<ImagePlaceholder>
Expand All @@ -58,7 +59,9 @@ const ProjectCard = (props: IProjectCard) => {
isAbsolute={true}
/>
{!isNew && (
<BadgeContainer>{verified && <VerifiedBadge />}</BadgeContainer>
<BadgeContainer>
{showVerifiedBadge && <VerifiedBadge />}
</BadgeContainer>
)}
<CardBody $isNew={isNew}>
<InternalLink href={slugToProjectView(slug)}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const DonatePageProjectDescription: FC<
<GivBackBadge />
</Flex>
)}
{projectData?.verified && (
{(projectData?.verified || projectData?.isGivbackEligible) && (
<Flex>
<VerifiedBadge />
</Flex>
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/donate/common/EligibilityBadges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ const EligibilityBadges: FC<IEligibilityBadges> = props => {
const { isConnected, chain } = useGeneralWallet();
const { activeStartedRound, project } = useDonateData();
const { formatMessage } = useIntl();
const { verified } = project || {};
const { isGivbackEligible } = project || {};
const router = useRouter();
const isStellar = router.query.chain === ChainType.STELLAR.toLowerCase();
const isTokenGivbacksEligible = token?.isGivbackEligible;
const isProjectGivbacksEligible = !!verified;
const isProjectGivbacksEligible = !!isGivbackEligible;
const networkId = isStellar
? config.STELLAR_NETWORK_NUMBER
: (chain as Chain)?.id
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/project/ProjectGIVbackToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const ProjectGIVbackToast = () => {
const { projectData, isAdmin, activateProject } = useProjectContext();
const verStatus = projectData?.verificationFormStatus;
const projectStatus = projectData?.status.name;
const isVerified = projectData?.verified;
const isGivbackEligible = projectData?.isGivbackEligible;
const isVerified = projectData?.verified;
const { givbackFactor } = projectData || {};
const isOwnerGivbackEligible = isGivbackEligible && isAdmin;
const isOwnerNotVerified = !isGivbackEligible && isAdmin;
Expand Down

0 comments on commit 47f272a

Please sign in to comment.