Selaa lähdekoodia

change boostrap modal

amenpunk 2 vuotta sitten
vanhempi
commit
77ef8dc276
2 muutettua tiedostoa jossa 27 lisäystä ja 17 poistoa
  1. 17 9
      src/Components/Modal/AgregarManual.js
  2. 10 8
      src/Components/Modal/PasswordModal.jsx

+ 17 - 9
src/Components/Modal/AgregarManual.js

@@ -1,7 +1,7 @@
1 1
 import React, { memo } from 'react';
2 2
 import * as Yup from 'yup';
3 3
 import { useFormik, Form, FormikProvider } from 'formik';
4
-import { Modal } from 'react-bootstrap'
4
+import { Dialog,DialogContent, DialogTitle,DialogActions } from '@mui/material'
5 5
 import toast, { Toaster } from 'react-hot-toast';
6 6
 
7 7
 import { AdapterDateFns as DateFnsUtils } from '@mui/x-date-pickers/AdapterDateFns';
@@ -126,13 +126,19 @@ function Manual(props) {
126 126
 
127 127
   return (
128 128
 
129
-    <Modal size="lg" aria-labelledby="contained-modal-title-vcenter" centered show={visible} onHide={onClose}>
129
+    <Dialog 
130
+      open={visible} 
131
+      fullWidth="lg" 
132
+      maxWidth="md" 
133
+      aria-labelledby="contained-modal-title-vcenter" 
134
+      onClose={onClose}>
130 135
 
131
-      <Modal.Header>
136
+      <DialogTitle>
132 137
         <button onClick={onClose} type="button" className="close" data-dismiss="modal">&times;</button>
133 138
         <h4 className="modal-title" style={{ color: '#252525' }}>Agregar Puesto</h4>
134
-      </Modal.Header>
135
-      <Modal.Body className="modal-body">
139
+      </DialogTitle>
140
+
141
+      <DialogContent className="modal-body">
136 142
 
137 143
         <Tabs value={tab} onChange={changeTab} aria-label="basic tabs example">
138 144
           <Tab label="Información" />
@@ -179,6 +185,7 @@ function Manual(props) {
179 185
                     label="Nombre"
180 186
                     fullWidth
181 187
                     {...getFieldProps('nombrepuesto')}
188
+                    helperText={touched.nombrepuesto && errors.nombrepuesto}
182 189
                     error={Boolean(touched.nombrepuesto && errors.nombrepuesto)}
183 190
                   />
184 191
 
@@ -269,7 +276,7 @@ function Manual(props) {
269 276
             </TabPanel>
270 277
 
271 278
 
272
-            <Modal.Footer>
279
+            <DialogActions>
273 280
               <Button
274 281
                 type="submit"
275 282
                 className="registerBtn"
@@ -277,11 +284,12 @@ function Manual(props) {
277 284
                 sx={{ mt: 1, mr: 1 }} >
278 285
                 {'Guardar'}
279 286
               </Button>
280
-            </Modal.Footer>
287
+            </DialogActions>
281 288
 
282 289
           </Form>
283 290
         </FormikProvider>
284
-      </Modal.Body>
291
+      </DialogContent>
292
+
285 293
       <Backdrop
286 294
         sx={{ color: '#fd4b4b', zIndex: (theme) => theme.zIndex.drawer + 1 }}
287 295
         open={open}
@@ -289,7 +297,7 @@ function Manual(props) {
289 297
         <CircularProgress color="inherit" />
290 298
       </Backdrop>
291 299
       <Toaster position="top-right" />
292
-    </Modal>
300
+    </Dialog>
293 301
   )
294 302
 }
295 303
 export default memo(Manual);

+ 10 - 8
src/Components/Modal/PasswordModal.jsx

@@ -1,4 +1,4 @@
1
-import { Modal } from 'react-bootstrap'
1
+import { Dialog,DialogContent, DialogTitle } from '@mui/material'
2 2
 import * as React from 'react';
3 3
 
4 4
 import {
@@ -109,16 +109,18 @@ export function HelpModal(props) {
109 109
 
110 110
 
111 111
   return (
112
-    <Modal size="lg"
112
+    <Dialog 
113
+      open={visible}
114
+      fullWidth="lg"
115
+      maxWidth="md"
113 116
       aria-labelledby="contained-modal-title-vcenter"
114
-      centered show={visible}
115 117
       onHide={handleClose}
116 118
     >
117
-      <Modal.Header>
119
+      <DialogTitle>
118 120
         <button type="button" className="close" onClick={handleClose}>&times;</button>
119 121
         <h4 className="modal-title">Crear Contraseña</h4>
120
-      </Modal.Header>
121
-      <Modal.Body className="modal-body">
122
+      </DialogTitle>
123
+      <DialogContent className="modal-body">
122 124
 
123 125
         <Box sx={{ width: '100%' }}>
124 126
           <Stepper
@@ -162,7 +164,7 @@ export function HelpModal(props) {
162 164
             )}
163 165
         </Box>
164 166
 
165
-      </Modal.Body>
166
-    </Modal>
167
+      </DialogContent>
168
+    </Dialog>
167 169
   )
168 170
 }