Skip to content

Commit

Permalink
oct-1484: cr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikolajczyk committed Mar 20, 2024
1 parent ab7470f commit 93deffa
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ButtonAddToAllocate: FC<ButtonAddToAllocateProps> = ({
const [isTooltipClicked, setIsTooltipClicked] = useState(false);
const [isTooltipVisible, setIsTooltipVisible] = useState(false);
const tooltipText = useMemo(() => {
if (isArchivedProject) {
if (isArchivedProject && isAllocatedTo) {
return t('donated');
}
if (isAddedToAllocate && isTooltipClicked) {
Expand All @@ -42,7 +42,7 @@ const ButtonAddToAllocate: FC<ButtonAddToAllocateProps> = ({
}
return t('saveToAllocate');
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isAddedToAllocate, isTooltipClicked, isArchivedProject]);
}, [isAddedToAllocate, isTooltipClicked, isArchivedProject, isAllocatedTo]);

const handleTooltipVisibilityChange = (isVisible: boolean) => {
setIsTooltipVisible(isVisible);
Expand All @@ -64,7 +64,7 @@ const ButtonAddToAllocate: FC<ButtonAddToAllocateProps> = ({
Icon={
<Tooltip
hideAfterClick
isDisabled={isPatronMode}
isDisabled={isPatronMode || (isArchivedProject && !isAddedToAllocate)}
onClickCallback={() => {
if (isTooltipVisible) {
setIsTooltipClicked(true);
Expand Down

0 comments on commit 93deffa

Please sign in to comment.