Skip to content

Commit ac975f0

Browse files
committed
feat: project list item rewards without threshold
1 parent f09b7cc commit ac975f0

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

client/src/components/Project/ProjectListItem/ProjectListItem.tsx

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import React, { FC, Fragment, memo, useMemo } from 'react';
22

33
import ProjectDonors from 'components/Project/ProjectDonors';
44
import ProjectListItemHeader from 'components/Project/ProjectListItemHeader';
5-
import Rewards from 'components/shared/RewardsWithThreshold';
5+
import RewardsWithoutThreshold from 'components/shared/RewardsWithoutThreshold';
6+
import RewardsWithThreshold from 'components/shared/RewardsWithThreshold';
67
import Description from 'components/ui/Description';
8+
import useCurrentEpoch from 'hooks/queries/useCurrentEpoch';
79
import decodeBase64ToUtf8 from 'utils/decodeBase64ToUtf8';
810

911
import styles from './ProjectListItem.module.scss';
@@ -20,6 +22,9 @@ const ProjectListItem: FC<ProjectListItemProps> = ({
2022
totalValueOfAllocations,
2123
numberOfDonors,
2224
}) => {
25+
const { data: currentEpoch } = useCurrentEpoch();
26+
const isEpoch1 = currentEpoch === 1;
27+
2328
const decodedDescription = useMemo(() => decodeBase64ToUtf8(description!), [description]);
2429

2530
return (
@@ -32,14 +37,24 @@ const ProjectListItem: FC<ProjectListItemProps> = ({
3237
profileImageSmall={profileImageSmall}
3338
website={website}
3439
/>
35-
<Rewards
36-
address={address}
37-
className={styles.projectRewards}
38-
epoch={epoch}
39-
isProjectView
40-
numberOfDonors={numberOfDonors}
41-
totalValueOfAllocations={totalValueOfAllocations}
42-
/>
40+
{!isEpoch1 && epoch && epoch < 4 && (
41+
<RewardsWithThreshold
42+
address={address}
43+
className={styles.projectRewards}
44+
epoch={epoch}
45+
isProjectView
46+
numberOfDonors={numberOfDonors}
47+
totalValueOfAllocations={totalValueOfAllocations}
48+
/>
49+
)}
50+
{!isEpoch1 && (!epoch || epoch >= 4) && (
51+
<RewardsWithoutThreshold
52+
className={styles.projectRewards}
53+
epoch={epoch}
54+
numberOfDonors={numberOfDonors}
55+
totalValueOfAllocations={totalValueOfAllocations}
56+
/>
57+
)}
4358
<Description
4459
dataTest="ProjectListItem__Description"
4560
innerHtml={decodedDescription}

0 commit comments

Comments
 (0)