Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions src/custom/Workspaces/WorkspaceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,24 +341,22 @@ const CardBack = ({
recentActivities,
updatedDate,
createdDate,
deleted,
isDeleteWorkspaceAllowed,
isEditWorkspaceAllowed
Comment thread
Rajesh-Nagarajan-11 marked this conversation as resolved.
}: CardBackProps) => {
const isWorkspaceSelected = selectedWorkspaces?.includes(workspaceId);
const isEditButtonDisabled = isWorkspaceSelected ? true : !isEditWorkspaceAllowed;
const isDeleteButtonDisabled = isWorkspaceSelected ? true : !isDeleteWorkspaceAllowed;

const theme = useTheme();
return (
<CardBackWrapper elevation={2} onClick={onFlipBack}>
<CardBackTopGrid size={12}>
<CardBackTitleGrid size={6}>
<BulkSelectCheckbox
onClick={(e) => e.stopPropagation()}
onChange={onSelect}
disabled={deleted ? true : !isDeleteWorkspaceAllowed}
/>
{isDeleteWorkspaceAllowed && (
<BulkSelectCheckbox
onClick={(e) => e.stopPropagation()}
onChange={onSelect}
/>
)}
Comment thread
Rajesh-Nagarajan-11 marked this conversation as resolved.
<CardTitle
sx={{ color: theme.palette.background.constant?.white }}
variant="body2"
Expand All @@ -368,18 +366,20 @@ const CardBack = ({
</CardTitle>
</CardBackTitleGrid>
<CardBackActionsGrid size={6}>
<L5EditIcon
onClick={onEdit}
disabled={isEditButtonDisabled}
style={{ fill: theme.palette.background.constant?.white }}
bulk={true}
/>
<L5DeleteIcon
onClick={onDelete}
style={{ fill: theme.palette.background.constant?.white }}
disabled={isDeleteButtonDisabled}
bulk={true}
/>
{!isWorkspaceSelected && isEditWorkspaceAllowed && (
<L5EditIcon
onClick={onEdit}
style={{ fill: theme.palette.background.constant?.white }}
bulk={true}
/>
)}
{!isWorkspaceSelected && isDeleteWorkspaceAllowed && (
<L5DeleteIcon
onClick={onDelete}
style={{ fill: theme.palette.background.constant?.white }}
bulk={true}
/>
)}
</CardBackActionsGrid>
</CardBackTopGrid>
<Grid2 sx={{ display: 'flex', alignItems: 'center', flexDirection: 'row' }}>
Expand Down
Loading