Skip to content

Commit 9d97c0a

Browse files
committed
feat(delete): add delelte action
Signed-off-by: Sudhanshu Dasgupta <[email protected]>
1 parent 2aa231c commit 9d97c0a

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

src/custom/CatalogDetail/ActionButton.tsx

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import React from 'react';
22
import { CircularProgress } from '../../base';
3-
import { CopyIcon, EditIcon, KanvasIcon, PublishIcon, ShareLineIcon } from '../../icons';
3+
import {
4+
CopyIcon,
5+
DeleteIcon,
6+
EditIcon,
7+
KanvasIcon,
8+
PublishIcon,
9+
ShareLineIcon
10+
} from '../../icons';
411
import Download from '../../icons/Download/Download';
512
import { charcoal, useTheme } from '../../theme';
613
import { Pattern } from '../CustomCatalog/CustomCard';
@@ -23,6 +30,8 @@ interface ActionButtonsProps {
2330
handleInfoClick?: () => void;
2431
showShareAction?: boolean;
2532
handleShare: () => void;
33+
showDeleteAction?: boolean;
34+
handleDelete: () => void;
2635
}
2736

2837
const ActionButtons: React.FC<ActionButtonsProps> = ({
@@ -39,7 +48,9 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
3948
showInfoAction,
4049
handleInfoClick,
4150
showShareAction,
42-
handleShare
51+
handleShare,
52+
showDeleteAction,
53+
handleDelete
4354
}) => {
4455
const cleanedType = type.replace('my-', '').replace(/s$/, '');
4556
const theme = useTheme();
@@ -155,7 +166,20 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
155166
Share
156167
</ActionButton>
157168
)}
169+
{showDeleteAction && (
170+
<UnpublishAction
171+
sx={{
172+
borderRadius: '0.2rem',
173+
gap: '10px'
174+
}}
175+
onClick={handleDelete}
176+
>
177+
<DeleteIcon width={24} height={24} fill={charcoal[100]} />
178+
Delete
179+
</UnpublishAction>
180+
)}
158181
</div>
182+
159183
{showUnpublishAction && (
160184
<UnpublishAction
161185
sx={{

src/custom/CatalogDetail/LeftPanel.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ interface LeftPanelProps {
2727
handleInfoClick?: () => void;
2828
showShareAction?: boolean;
2929
handleShare: () => void;
30+
showDeleteAction?: boolean;
31+
handleDelete: () => void;
3032
}
3133

3234
const LeftPanel: React.FC<LeftPanelProps> = ({
@@ -48,7 +50,9 @@ const LeftPanel: React.FC<LeftPanelProps> = ({
4850
showInfoAction = false,
4951
handleInfoClick,
5052
showShareAction = false,
51-
handleShare
53+
handleShare,
54+
showDeleteAction = false,
55+
handleDelete
5256
}) => {
5357
const theme = useTheme();
5458

@@ -95,6 +99,8 @@ const LeftPanel: React.FC<LeftPanelProps> = ({
9599
handleInfoClick={handleInfoClick}
96100
showShareAction={showShareAction}
97101
handleShare={handleShare}
102+
showDeleteAction={showDeleteAction}
103+
handleDelete={handleDelete}
98104
/>
99105
{showTechnologies && (
100106
<TechnologySection

0 commit comments

Comments
 (0)