Skip to content

Commit

Permalink
chore: revert exposing e
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhishekA1509 committed Nov 21, 2023
1 parent 4c0ee0a commit 4ff6b01
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
"version": "0.0.40-beta-13",
"version": "0.0.40-beta-14",
"description": "Supporting common component library",
"main": "dist/index.js",
"scripts": {
Expand Down
14 changes: 12 additions & 2 deletions src/Common/Dialogs/DeleteDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ import ConfirmationDialog from './ConfirmationDialog'
import { DeleteDialogProps } from './Types'

export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.FC<any> } = function (props) {
const handleDelete = (e: React.MouseEvent) => {
e.stopPropagation()
props.delete()
}

const handleModalClose = (e: React.MouseEvent) => {
e.stopPropagation()
props.closeDelete()
}

return (
<ConfirmationDialog className="confirmation-dialog__body--w-400">
<ConfirmationDialog.Icon src={warn} />
Expand All @@ -19,7 +29,7 @@ export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.F
<button
type="button"
className="cta cancel cta-cd-delete-modal ml-16"
onClick={props.closeDelete}
onClick={handleModalClose}
disabled={props.apiCallInProgress}
data-testid="dialog-cancel"
>
Expand All @@ -28,7 +38,7 @@ export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.F
<button
type="button"
className="cta delete cta-cd-delete-modal ml-16"
onClick={props.delete}
onClick={handleDelete}
disabled={props.apiCallInProgress}
data-testid="dialog-delete"
>
Expand Down
4 changes: 2 additions & 2 deletions src/Common/Dialogs/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ReactNode } from "react"
export interface DeleteDialogProps {
title: string
description?: string
closeDelete: (e?: React.MouseEvent) => void
delete: (e?: React.MouseEvent) => any
closeDelete: () => void
delete: () => any
deletePrefix?: string
deletePostfix?: string
apiCallInProgress?: boolean
Expand Down

0 comments on commit 4ff6b01

Please sign in to comment.