File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
packages/ra-ui-materialui/src/layout Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+
3+ import { Confirm } from './Confirm' ;
4+
5+ export default {
6+ title : 'ra-ui-materialui/layout/Confirm' ,
7+ } ;
8+
9+ export const BackClick = ( ) => {
10+ const [ isOpen , setIsOpen ] = React . useState ( false ) ;
11+ const [ isClicked , setIsClicked ] = React . useState ( false ) ;
12+
13+ return (
14+ < >
15+ < button
16+ onClick = { e => {
17+ setIsOpen ( true ) ;
18+ e . stopPropagation ( ) ;
19+ } }
20+ >
21+ Open Dialog
22+ </ button >
23+ < div
24+ onClick = { ( ) => setIsClicked ( true ) }
25+ style = { {
26+ height : '100vh' ,
27+ width : '100%' ,
28+ backgroundColor : 'red' ,
29+ padding : 10 ,
30+ } }
31+ >
32+ < div > Back layer { isClicked ? 'clicked' : 'not Clicked' } </ div >
33+ < Confirm
34+ isOpen = { isOpen }
35+ title = "Delete Item"
36+ content = "Are you sure you want to delete this item?"
37+ confirm = "Yes"
38+ confirmColor = "primary"
39+ onConfirm = { ( ) => setIsOpen ( false ) }
40+ onClose = { ( ) => setIsOpen ( false ) }
41+ />
42+ </ div >
43+ </ >
44+ ) ;
45+ } ;
You can’t perform that action at this time.
0 commit comments