Skip to content

Commit

Permalink
feat(delete): add delelte action
Browse files Browse the repository at this point in the history
Signed-off-by: Sudhanshu Dasgupta <[email protected]>
  • Loading branch information
sudhanshutech committed Dec 17, 2024
1 parent 2aa231c commit 9d97c0a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
28 changes: 26 additions & 2 deletions src/custom/CatalogDetail/ActionButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import React from 'react';
import { CircularProgress } from '../../base';
import { CopyIcon, EditIcon, KanvasIcon, PublishIcon, ShareLineIcon } from '../../icons';
import {
CopyIcon,
DeleteIcon,
EditIcon,
KanvasIcon,
PublishIcon,
ShareLineIcon
} from '../../icons';
import Download from '../../icons/Download/Download';
import { charcoal, useTheme } from '../../theme';
import { Pattern } from '../CustomCatalog/CustomCard';
Expand All @@ -23,6 +30,8 @@ interface ActionButtonsProps {
handleInfoClick?: () => void;
showShareAction?: boolean;
handleShare: () => void;
showDeleteAction?: boolean;
handleDelete: () => void;
}

const ActionButtons: React.FC<ActionButtonsProps> = ({
Expand All @@ -39,7 +48,9 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
showInfoAction,
handleInfoClick,
showShareAction,
handleShare
handleShare,
showDeleteAction,
handleDelete
}) => {
const cleanedType = type.replace('my-', '').replace(/s$/, '');
const theme = useTheme();
Expand Down Expand Up @@ -155,7 +166,20 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
Share
</ActionButton>
)}
{showDeleteAction && (
<UnpublishAction
sx={{
borderRadius: '0.2rem',
gap: '10px'
}}
onClick={handleDelete}
>
<DeleteIcon width={24} height={24} fill={charcoal[100]} />
Delete
</UnpublishAction>
)}
</div>

{showUnpublishAction && (
<UnpublishAction
sx={{
Expand Down
8 changes: 7 additions & 1 deletion src/custom/CatalogDetail/LeftPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ interface LeftPanelProps {
handleInfoClick?: () => void;
showShareAction?: boolean;
handleShare: () => void;
showDeleteAction?: boolean;
handleDelete: () => void;
}

const LeftPanel: React.FC<LeftPanelProps> = ({
Expand All @@ -48,7 +50,9 @@ const LeftPanel: React.FC<LeftPanelProps> = ({
showInfoAction = false,
handleInfoClick,
showShareAction = false,
handleShare
handleShare,
showDeleteAction = false,
handleDelete
}) => {
const theme = useTheme();

Expand Down Expand Up @@ -95,6 +99,8 @@ const LeftPanel: React.FC<LeftPanelProps> = ({
handleInfoClick={handleInfoClick}
showShareAction={showShareAction}
handleShare={handleShare}
showDeleteAction={showDeleteAction}
handleDelete={handleDelete}
/>
{showTechnologies && (
<TechnologySection
Expand Down

0 comments on commit 9d97c0a

Please sign in to comment.