Skip to content

Commit

Permalink
feat: project list item rewards without threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
aziolek committed Jul 15, 2024
1 parent f09b7cc commit ac975f0
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions client/src/components/Project/ProjectListItem/ProjectListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import React, { FC, Fragment, memo, useMemo } from 'react';

import ProjectDonors from 'components/Project/ProjectDonors';
import ProjectListItemHeader from 'components/Project/ProjectListItemHeader';
import Rewards from 'components/shared/RewardsWithThreshold';
import RewardsWithoutThreshold from 'components/shared/RewardsWithoutThreshold';
import RewardsWithThreshold from 'components/shared/RewardsWithThreshold';
import Description from 'components/ui/Description';
import useCurrentEpoch from 'hooks/queries/useCurrentEpoch';
import decodeBase64ToUtf8 from 'utils/decodeBase64ToUtf8';

import styles from './ProjectListItem.module.scss';
Expand All @@ -20,6 +22,9 @@ const ProjectListItem: FC<ProjectListItemProps> = ({
totalValueOfAllocations,
numberOfDonors,
}) => {
const { data: currentEpoch } = useCurrentEpoch();
const isEpoch1 = currentEpoch === 1;

const decodedDescription = useMemo(() => decodeBase64ToUtf8(description!), [description]);

return (
Expand All @@ -32,14 +37,24 @@ const ProjectListItem: FC<ProjectListItemProps> = ({
profileImageSmall={profileImageSmall}
website={website}
/>
<Rewards
address={address}
className={styles.projectRewards}
epoch={epoch}
isProjectView
numberOfDonors={numberOfDonors}
totalValueOfAllocations={totalValueOfAllocations}
/>
{!isEpoch1 && epoch && epoch < 4 && (
<RewardsWithThreshold
address={address}
className={styles.projectRewards}
epoch={epoch}
isProjectView
numberOfDonors={numberOfDonors}
totalValueOfAllocations={totalValueOfAllocations}
/>
)}
{!isEpoch1 && (!epoch || epoch >= 4) && (
<RewardsWithoutThreshold
className={styles.projectRewards}
epoch={epoch}
numberOfDonors={numberOfDonors}
totalValueOfAllocations={totalValueOfAllocations}
/>
)}
<Description
dataTest="ProjectListItem__Description"
innerHtml={decodedDescription}
Expand Down

0 comments on commit ac975f0

Please sign in to comment.