소스 검색

[ADD] file uploader testing

amenpunk 3 년 전
부모
커밋
89d2b13fe2
4개의 변경된 파일63개의 추가작업 그리고 16개의 파일을 삭제
  1. 4 0
      psicoadmin/src/App.css
  2. 4 4
      psicoadmin/src/Components/Footer.js
  3. 5 2
      psicoadmin/src/Css/all.css
  4. 50 10
      psicoadmin/src/Pages/Puestos.js

+ 4 - 0
psicoadmin/src/App.css

@@ -113,3 +113,7 @@
113 113
     padding-left: 0px !important;
114 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,10 +4,10 @@ import Link from '@mui/material/Link';
4 4
 
5 5
 export default function Footer(props) {
6 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 11
             <Link color="inherit" href="#">
12 12
                 Propiedad de Grupo DIT {new Date().getFullYear()}
13 13
             </Link>

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

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

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

@@ -1,7 +1,8 @@
1
-import * as React from 'react';
1
+import React, {  } from 'react';
2 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 6
 import ToggleButton from '@mui/material/ToggleButton';
6 7
 import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
7 8
 
@@ -12,6 +13,11 @@ import RemoveRedEyeIcon from '@mui/icons-material/RemoveRedEye';
12 13
 import EditIcon from '@mui/icons-material/Edit';
13 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 21
 import NotFound from '../Images/not_found.png';
16 22
     
17 23
 let data = [{
@@ -36,7 +42,6 @@ for ( var _ of new Array(23) ){
36 42
         d : _ 
37 43
     })
38 44
 }
39
-
40 45
 function ListMode() {
41 46
 
42 47
     let actions = [
@@ -115,7 +120,7 @@ function GridMode () {
115 120
                 data.length ? 
116 121
                 data.map( plaza => {
117 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 124
                             <div className="panel">
120 125
                                 <Row>
121 126
                                     <Col md="4">
@@ -145,8 +150,28 @@ function GridMode () {
145 150
 
146 151
 function Manual ( props ) {
147 152
 
153
+    let [ filename, setFilename ] = React.useState(null);
154
+
148 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 175
     return (
151 176
         <Modal size="lg" aria-labelledby="contained-modal-title-vcenter" centered  show={visible} onHide={onClose}>
152 177
             <Modal.Header>
@@ -157,13 +182,28 @@ function Manual ( props ) {
157 182
                 <Row>
158 183
                     <Col md="4">
159 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 186
                         </div>
162 187
                     </Col>
163 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 207
                     </Col>
168 208
                 </Row>
169 209
                 <div className="data_product">
@@ -175,7 +215,7 @@ function Manual ( props ) {
175 215
                         </Col>
176 216
                         <div className="add_producto_confirm">
177 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 219
                             </div>
180 220
                         </div>
181 221
                     </Row>
@@ -201,7 +241,7 @@ function Express (props) {
201 241
                         </div>
202 242
                         <div className="add_producto_confirm">
203 243
                             <div className="btn_add_producto_confirm">
204
-                                <Button type="submit">Agregar plaza</Button>
244
+                                <span type="submit">Agregar plaza</span>
205 245
                             </div>
206 246
                         </div>
207 247
                     </div>