generated from Code-4-Community/frontend-scaffold
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move delete functionality to clean branch
- Loading branch information
SurabhiKeesara
committed
Dec 7, 2023
1 parent
15a5e3f
commit 9e0d4d4
Showing
8 changed files
with
176 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from 'react'; | ||
import { Button, Modal } from 'antd'; | ||
import { StyledClose } from '../themedComponents'; | ||
import styled from 'styled-components'; | ||
import { LIGHT_GREY } from '../../utils/colors'; | ||
|
||
const ConfirmDeleteButton = styled(Button)` | ||
margin: 10px; | ||
padding-left: 10px; | ||
& :hover { | ||
background-color: ${LIGHT_GREY}; | ||
} | ||
`; | ||
|
||
interface ConfirmationModalProps { | ||
visible: boolean; | ||
onOk: () => void; | ||
onCancel: () => void; | ||
title: string; | ||
confirmationMessage: string; | ||
onConfirm: () => void; | ||
} | ||
|
||
const ConfirmationModal: React.FC<ConfirmationModalProps> = ({ | ||
visible, | ||
onOk, | ||
onCancel, | ||
confirmationMessage, | ||
title, | ||
onConfirm, | ||
}) => { | ||
return ( | ||
<> | ||
<Modal | ||
title={title} | ||
visible={visible} | ||
onOk={onOk} | ||
onCancel={onCancel} | ||
footer={null} | ||
closeIcon={<StyledClose />} | ||
> | ||
<p>{confirmationMessage}</p> | ||
<ConfirmDeleteButton onClick={onConfirm}>Delete</ConfirmDeleteButton> | ||
</Modal> | ||
</> | ||
); | ||
}; | ||
|
||
export default ConfirmationModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters