Browse Source

change boostrap modal

amenpunk 2 years ago
parent
commit
77ef8dc276
2 changed files with 27 additions and 17 deletions
  1. 17 9
      src/Components/Modal/AgregarManual.js
  2. 10 8
      src/Components/Modal/PasswordModal.jsx

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

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

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

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