Browse Source

[ADD] file uploader testing

amenpunk 3 years ago
parent
commit
89d2b13fe2

+ 4 - 0
psicoadmin/src/App.css

113
     padding-left: 0px !important;
113
     padding-left: 0px !important;
114
     padding-right: 0 !important;
114
     padding-right: 0 !important;
115
 }
115
 }
116
+
117
+.css-12jypm1-MuiToolbar-root {
118
+    padding-left : 20px !important;
119
+}

+ 4 - 4
psicoadmin/src/Components/Footer.js

4
 
4
 
5
 export default function Footer(props) {
5
 export default function Footer(props) {
6
     return (
6
     return (
7
-        <Typography className="footerinfo" variant="body2" color="text.secondary" align="center" {...props}>
8
-            <a href="#">LICENCIA DE USO</a>
9
-            <a href="#">DERECHOS</a>
10
-            <a href="#">PRIVACIDAD</a>
7
+        <Typography style={{ paddingLeft : 25 }} className="footerinfo" variant="body2" color="text.secondary" align="center" {...props}>
8
+            <Link>LICENCIA DE USO</Link>
9
+            <Link>DERECHOS</Link>
10
+            <Link>PRIVACIDAD</Link>
11
             <Link color="inherit" href="#">
11
             <Link color="inherit" href="#">
12
                 Propiedad de Grupo DIT {new Date().getFullYear()}
12
                 Propiedad de Grupo DIT {new Date().getFullYear()}
13
             </Link>
13
             </Link>

+ 5 - 2
psicoadmin/src/Css/all.css

215
 }
215
 }
216
 .content-section {
216
 .content-section {
217
     background-color : #f1f1f1;
217
     background-color : #f1f1f1;
218
-    padding: 70px 0px;
218
+    padding: 70px 15px;
219
 }
219
 }
220
 .nav-item a i{
220
 .nav-item a i{
221
     color: #212529;
221
     color: #212529;
952
     border-radius: 20px;
952
     border-radius: 20px;
953
     color: #fff;
953
     color: #fff;
954
     font-size: 12px;
954
     font-size: 12px;
955
+    padding: 10px;
955
 }
956
 }
956
 .btn_add_producto_confirm:hover {
957
 .btn_add_producto_confirm:hover {
957
     border: 1px solid #2ec5d3;
958
     border: 1px solid #2ec5d3;
961
 }
962
 }
962
 .btn_add_producto_confirm a {
963
 .btn_add_producto_confirm a {
963
     display: block;
964
     display: block;
964
-    padding: 10px;
965
+}
966
+.btn_add_producto_confirm span {
967
+    display: block;
965
 }
968
 }
966
 [type=reset], [type=submit], button, html [type=button] {
969
 [type=reset], [type=submit], button, html [type=button] {
967
     -webkit-appearance: initial;
970
     -webkit-appearance: initial;

+ 50 - 10
psicoadmin/src/Pages/Puestos.js

1
-import * as React from 'react';
1
+import React, {  } from 'react';
2
 import { Row, Col, Modal, Button, Table } from 'react-bootstrap'
2
 import { Row, Col, Modal, Button, Table } from 'react-bootstrap'
3
+import { Box, Typography, Button as MuiButton, ListItem, withStyles } from '@mui/material';
4
+
3
 
5
 
4
-import Box from '@mui/material/Box';
5
 import ToggleButton from '@mui/material/ToggleButton';
6
 import ToggleButton from '@mui/material/ToggleButton';
6
 import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
7
 import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
7
 
8
 
12
 import EditIcon from '@mui/icons-material/Edit';
13
 import EditIcon from '@mui/icons-material/Edit';
13
 import HighlightOffIcon from '@mui/icons-material/HighlightOff';
14
 import HighlightOffIcon from '@mui/icons-material/HighlightOff';
14
 
15
 
16
+///import { makeStyles, useTheme } from "@material-ui/core/styles";
17
+import { makeStyles, useTheme } from "@mui/material/styles";
18
+import TextField from "@mui/material/TextField";
19
+import ButtonBase from "@mui/material/ButtonBase";
20
+
15
 import NotFound from '../Images/not_found.png';
21
 import NotFound from '../Images/not_found.png';
16
     
22
     
17
 let data = [{
23
 let data = [{
36
         d : _ 
42
         d : _ 
37
     })
43
     })
38
 }
44
 }
39
-
40
 function ListMode() {
45
 function ListMode() {
41
 
46
 
42
     let actions = [
47
     let actions = [
115
                 data.length ? 
120
                 data.length ? 
116
                 data.map( plaza => {
121
                 data.map( plaza => {
117
                     return(
122
                     return(
118
-                        <Col key={plaza.id} lg="3" md="6" sm="6" xs="12" >
123
+                        <Col key={plaza.id} lg="4" md="6" sm="6" xs="12" >
119
                             <div className="panel">
124
                             <div className="panel">
120
                                 <Row>
125
                                 <Row>
121
                                     <Col md="4">
126
                                     <Col md="4">
145
 
150
 
146
 function Manual ( props ) {
151
 function Manual ( props ) {
147
 
152
 
153
+    let [ filename, setFilename ] = React.useState(null);
154
+
148
     let { visible, onClose } = props
155
     let { visible, onClose } = props
149
 
156
 
157
+    // Create a reference to the hidden file input element
158
+    const hiddenFileInput = React.useRef(null);
159
+
160
+    // Programatically click the hidden file input element
161
+    // when the Button component is clicked
162
+    const handleClick = event => {
163
+        hiddenFileInput.current.click();
164
+    };
165
+    // Call a function (passed as a prop from the parent component)
166
+    // to handle the user-selected file 
167
+    const handleChange = event => {
168
+        const fileUploaded = event.target.files[0];
169
+        console.log( "FILE >> ", fileUploaded )
170
+        setFilename( fileUploaded.name )
171
+        //props.handleFile(fileUploaded);
172
+    };
173
+
174
+
150
     return (
175
     return (
151
         <Modal size="lg" aria-labelledby="contained-modal-title-vcenter" centered  show={visible} onHide={onClose}>
176
         <Modal size="lg" aria-labelledby="contained-modal-title-vcenter" centered  show={visible} onHide={onClose}>
152
             <Modal.Header>
177
             <Modal.Header>
157
                 <Row>
182
                 <Row>
158
                     <Col md="4">
183
                     <Col md="4">
159
                         <div className="img-container">
184
                         <div className="img-container">
160
-                            <img alt="not found img" src="images/not_found.png"/>
185
+                            <img alt="agregar plaza manual" src={NotFound}/>
161
                         </div>
186
                         </div>
162
                     </Col>
187
                     </Col>
163
                     <Col md="8">
188
                     <Col md="8">
164
-                        <div className="custom-file-upload">
165
-                            <input type="file" id="file" name="myfiles[]" multiple />
166
-                        </div>
189
+
190
+                        <input 
191
+                            value={ filename ? filename : "" } 
192
+                            type="text" 
193
+                            class="file-upload-input" 
194
+                            disabled="" 
195
+                            placeholder="Ningún archivo seleccionado"/>
196
+
197
+                        <Button className="btn_add_producto_confirm" style={{ marginLeft : 15 }} onClick={handleClick}>
198
+                            SUBIR FOTO
199
+                        </Button>
200
+                        <input
201
+                            type="file"
202
+                            ref={hiddenFileInput}
203
+                            onChange={handleChange}
204
+                            style={{display: 'none'}}
205
+                        />
206
+
167
                     </Col>
207
                     </Col>
168
                 </Row>
208
                 </Row>
169
                 <div className="data_product">
209
                 <div className="data_product">
175
                         </Col>
215
                         </Col>
176
                         <div className="add_producto_confirm">
216
                         <div className="add_producto_confirm">
177
                             <div className="btn_add_producto_confirm">
217
                             <div className="btn_add_producto_confirm">
178
-                                <span style={{ margin : 15 }} type="submit">Agregar plaza</span>
218
+                                <span type="submit">Agregar plaza</span>
179
                             </div>
219
                             </div>
180
                         </div>
220
                         </div>
181
                     </Row>
221
                     </Row>
201
                         </div>
241
                         </div>
202
                         <div className="add_producto_confirm">
242
                         <div className="add_producto_confirm">
203
                             <div className="btn_add_producto_confirm">
243
                             <div className="btn_add_producto_confirm">
204
-                                <Button type="submit">Agregar plaza</Button>
244
+                                <span type="submit">Agregar plaza</span>
205
                             </div>
245
                             </div>
206
                         </div>
246
                         </div>
207
                     </div>
247
                     </div>