forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from OpsMx/bugfix/OP-19172-deletePopup-master
feat: Delete popup handled with a message
- Loading branch information
Showing
6 changed files
with
120 additions
and
4 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
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,63 @@ | ||
/* Popup style */ | ||
.popup-box { | ||
position: fixed; | ||
display: flex; | ||
background: #00000050; | ||
display: flex; | ||
width: 100%; | ||
height: 100vh; | ||
top: 0; | ||
left: 0; | ||
z-index: 10; | ||
align-items: center; | ||
|
||
} | ||
|
||
.alignBox{ | ||
margin: 0 auto; | ||
} | ||
|
||
.header{ | ||
color: #fff; | ||
font-weight: bold; | ||
position: relative; | ||
width: 700px; | ||
margin: 0 auto; | ||
height: auto; | ||
max-height: 70vh; | ||
margin-top: calc(100vh - 85vh - 30vh); | ||
background-color: #5fba6e; | ||
padding: 10px 20px; | ||
overflow: auto; | ||
|
||
} | ||
|
||
.content-box { | ||
font-size: 18px; | ||
position: relative; | ||
width: 700px; | ||
margin: 0 auto; | ||
height: auto; | ||
max-height: 70vh; | ||
/* margin-top: calc(100vh - 85vh - 20px); */ | ||
background: #fff; | ||
padding: 20px; | ||
/* border: 1px solid #999; */ | ||
overflow: auto; | ||
} | ||
|
||
.close-icon { | ||
content: 'x'; | ||
cursor: pointer; | ||
position: fixed; | ||
right: calc(15% - 30px); | ||
top: calc(100vh - 85vh - 33px); | ||
background: #ededed; | ||
width: 25px; | ||
height: 25px; | ||
border-radius: 50%; | ||
line-height: 20px; | ||
text-align: center; | ||
border: 1px solid #999; | ||
font-size: 20px; | ||
} |
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,33 @@ | ||
import * as React from 'react'; | ||
import { useState } from 'react'; | ||
require('./popup.css'); | ||
|
||
|
||
const PopupModal = (props: { | ||
isOpen: boolean; | ||
content: string | number | boolean | {} | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactNodeArray | React.ReactPortal; | ||
header: string; | ||
}) => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
const handleClose =()=> setIsOpen(false); | ||
|
||
React.useEffect(() => { | ||
setIsOpen(props.isOpen) | ||
}, [props.isOpen]) | ||
|
||
return ( | ||
isOpen && (<div className="popup-box"> | ||
<div className='alignBox'> | ||
<div className='header'> | ||
{props.header} | ||
</div> | ||
<div className="content-box"> | ||
{/* <span className="close-icon" onClick={handleClose}>x</span> */} | ||
{props.content} | ||
</div> | ||
</div> | ||
</div>) | ||
); | ||
}; | ||
|
||
export default PopupModal; |