@@ -37,6 +37,8 @@ const DialogCode = () => {
3737 const location = useLocation ( ) ;
3838 const { isDark } = useStyledDarkMode ( ) ;
3939 const [ open , setOpen ] = useState ( false ) ;
40+ const [ openFull , setOpenFull ] = useState ( false ) ;
41+ const [ openForm , setOpenForm ] = useState ( false ) ;
4042
4143 const handleOpen = ( ) => setOpen ( true ) ;
4244 const handleClose = ( ) => setOpen ( false ) ;
@@ -87,6 +89,51 @@ const DialogCode = () => {
8789
8890 < h3 style = { { marginTop : "2rem" } } > Code Snippet</ h3 >
8991 < CodeBlock name = "dialog-basic" code = { dialogCodeExample } />
92+
93+ { /* Full Screen Dialog */ }
94+ < h3 style = { { marginTop : "3rem" } } > Full-Screen Dialog Example</ h3 >
95+ < SistentThemeProvider initialMode = { isDark ? "dark" : "light" } >
96+ < Button onClick = { ( ) => setOpenFull ( true ) } > Open Full-Screen Dialog</ Button >
97+ < Dialog
98+ open = { openFull }
99+ onClose = { ( ) => setOpenFull ( false ) }
100+ style = { { width : "100%" , height : "100vh" , maxWidth : "none" } }
101+ >
102+ < DialogTitle > Full-Screen Dialog</ DialogTitle >
103+ < DialogContent >
104+ < p > This dialog stretches to full screen. Use it when the user's full attention is needed.</ p >
105+ </ DialogContent >
106+ < DialogActions >
107+ < Button onClick = { ( ) => setOpenFull ( false ) } > Cancel</ Button >
108+ < Button color = "primary" onClick = { ( ) => setOpenFull ( false ) } > Save</ Button >
109+ </ DialogActions >
110+ </ Dialog >
111+ </ SistentThemeProvider >
112+
113+ { /* Form Inside Dialog */ }
114+ < h3 style = { { marginTop : "3rem" } } > Dialog with Form Example</ h3 >
115+ < SistentThemeProvider initialMode = { isDark ? "dark" : "light" } >
116+ < Button onClick = { ( ) => setOpenForm ( true ) } > Open Form Dialog</ Button >
117+ < Dialog open = { openForm } onClose = { ( ) => setOpenForm ( false ) } >
118+ < DialogTitle > Subscribe</ DialogTitle >
119+ < DialogContent >
120+ < form style = { { display : 'flex' , flexDirection : 'column' , gap : '1rem' } } >
121+ < label >
122+ Email Address:
123+ < input type = "email" placeholder = "you@example.com" style = { { width : '100%' , padding : '0.5rem' } } />
124+ </ label >
125+ < label >
126+ Name:
127+ < input type = "text" placeholder = "John Doe" style = { { width : '100%' , padding : '0.5rem' } } />
128+ </ label >
129+ </ form >
130+ </ DialogContent >
131+ < DialogActions >
132+ < Button onClick = { ( ) => setOpenForm ( false ) } > Cancel</ Button >
133+ < Button color = "primary" onClick = { ( ) => setOpenForm ( false ) } > Subscribe</ Button >
134+ </ DialogActions >
135+ </ Dialog >
136+ </ SistentThemeProvider >
90137 </ div >
91138 </ div >
92139 </ SistentLayout >
0 commit comments