Skip to content

Commit

Permalink
Merge branch 'feature/oct-1275-hidden-add-to-allocate-button' into 'm…
Browse files Browse the repository at this point in the history
…aster'

OCT-1275: Make the visual difference between live & archived projects more clear

See merge request golemfoundation/governance/octant!1091
  • Loading branch information
Jakub Mikołajczyk committed Jan 25, 2024
2 parents f062769 + d275196 commit 80e5fc4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ const ProposalListItemHeader: FC<ProposalListItemHeaderProps> = ({
const [isLinkCopied, setIsLinkCopied] = useState(false);

const isArchivedProposal = epoch !== undefined;
const isAllocatedTo = !!userAllocations?.elements.find(
({ address: userAllocationAddress }) => userAllocationAddress === address,
);

const onShareClick = (): boolean | Promise<boolean> => {
const { origin } = window.location;
Expand Down Expand Up @@ -90,18 +93,16 @@ const ProposalListItemHeader: FC<ProposalListItemHeaderProps> = ({
size={3.2}
/>
</Tooltip>
<ButtonAddToAllocate
className={styles.buttonAddToAllocate}
dataTest="ProposalListItemHeader__ButtonAddToAllocate"
isAddedToAllocate={allocations.includes(address)}
isAllocatedTo={
!!userAllocations?.elements.find(
({ address: userAllocationAddress }) => userAllocationAddress === address,
)
}
isArchivedProposal={isArchivedProposal}
onClick={() => onAddRemoveFromAllocate(address)}
/>
{((isAllocatedTo && isArchivedProposal) || !isArchivedProposal) && (
<ButtonAddToAllocate
className={styles.buttonAddToAllocate}
dataTest="ProposalListItemHeader__ButtonAddToAllocate"
isAddedToAllocate={allocations.includes(address)}
isAllocatedTo={isAllocatedTo}
isArchivedProposal={isArchivedProposal}
onClick={() => onAddRemoveFromAllocate(address)}
/>
)}
</div>
</div>
<span className={styles.name} data-test="ProposalListItemHeader__name">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,20 @@ const ProposalsListItem: FC<ProposalsListItemProps> = ({
}
src={`${ipfsGateway}${profileImageSmall}`}
/>
<ButtonAddToAllocate
className={styles.button}
dataTest={
epoch
? 'ProposalsListItem__ButtonAddToAllocate--archive'
: 'ProposalsListItem__ButtonAddToAllocate'
}
isAddedToAllocate={isAddedToAllocate}
isAllocatedTo={isAllocatedTo}
isArchivedProposal={isArchivedProposal}
onClick={() => onAddRemoveFromAllocate(address)}
/>
{((isAllocatedTo && isArchivedProposal) || !isArchivedProposal) && (
<ButtonAddToAllocate
className={styles.button}
dataTest={
epoch
? 'ProposalsListItem__ButtonAddToAllocate--archive'
: 'ProposalsListItem__ButtonAddToAllocate'
}
isAddedToAllocate={isAddedToAllocate}
isAllocatedTo={isAllocatedTo}
isArchivedProposal={isArchivedProposal}
onClick={() => onAddRemoveFromAllocate(address)}
/>
)}
</div>
<div className={styles.body}>
<div
Expand Down

0 comments on commit 80e5fc4

Please sign in to comment.