Browse Source

grid in list view plazas

amenpunk 3 years ago
parent
commit
85a5f777de
4 changed files with 42 additions and 30 deletions
  1. 9 0
      src/App.css
  2. 1 1
      src/Components/Puestos/GridMode.jsx
  3. 8 10
      src/Css/all.css
  4. 24 19
      src/Pages/Puestos.jsx

+ 9 - 0
src/App.css

207
 #login_btn_fn:hover{
207
 #login_btn_fn:hover{
208
     background-color: var(--second)
208
     background-color: var(--second)
209
 }
209
 }
210
+
211
+.btn_plaza_common{
212
+    cursor:pointer;
213
+}
214
+
215
+.btn_plaza_common:hover{
216
+    color:var(--second) !important;
217
+}
218
+

+ 1 - 1
src/Components/Puestos/GridMode.jsx

1
 import React from "react";
1
 import React from "react";
2
 import NotFound from '../../Images/not_found.png';
2
 import NotFound from '../../Images/not_found.png';
3
+
3
 import { 
4
 import { 
4
     RemoveRedEye as RemoveRedEyeIcon,
5
     RemoveRedEye as RemoveRedEyeIcon,
5
     Edit as EditIcon,
6
     Edit as EditIcon,
18
             {
19
             {
19
                 data.length ? 
20
                 data.length ? 
20
                     data.map( plaza => {
21
                     data.map( plaza => {
21
-                        console.log('plaza', plaza)
22
                         return(
22
                         return(
23
                             <Col key={plaza.id} lg="4" md="6" sm="6" xs="12" >
23
                             <Col key={plaza.id} lg="4" md="6" sm="6" xs="12" >
24
                                 <div className="panel">
24
                                 <div className="panel">

+ 8 - 10
src/Css/all.css

3
     outline: 0 !important;
3
     outline: 0 !important;
4
     font-family: 'gudea' !important;
4
     font-family: 'gudea' !important;
5
 }
5
 }
6
-.row {
7
-    margin: 0 !important;
8
-    padding: 0;
9
-}
10
 @font-face {
6
 @font-face {
11
     font-family: gudea;
7
     font-family: gudea;
12
     src: url("../Fonts/Gudea-Regular.ttf"); /* TTF file for CSS3 browsers */
8
     src: url("../Fonts/Gudea-Regular.ttf"); /* TTF file for CSS3 browsers */
314
     margin-bottom: 24px;
310
     margin-bottom: 24px;
315
 }
311
 }
316
 .body-table {
312
 .body-table {
317
-    padding: 40px;
313
+    /* padding: 40px; */
314
+    padding: 15px;
318
     background: #24344d;
315
     background: #24344d;
319
     border-radius: 2px;
316
     border-radius: 2px;
320
     box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 -1px 0 rgba(0,0,0,.02); 
317
     box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 -1px 0 rgba(0,0,0,.02); 
806
 .add_producto {
803
 .add_producto {
807
     width: 150px;
804
     width: 150px;
808
     text-align: center;
805
     text-align: center;
809
-    margin-bottom: 40px;
806
+    /* margin-bottom: 40px; */
810
     float: right;
807
     float: right;
811
 }
808
 }
812
 .btn_add_producto {
809
 .btn_add_producto {
813
-    border: 1px solid #2ec5d3;
814
-    background: #2ec5d3;
815
-    border-radius: 20px;
810
+    border: 1px solid var(--second);
811
+    background: var(--second);
812
+    border-radius: 10px;
816
     color: #fff;
813
     color: #fff;
817
     font-size: 12px;
814
     font-size: 12px;
815
+    margin : 3px;
818
 }
816
 }
819
 .btn_add_producto:hover {
817
 .btn_add_producto:hover {
820
     border: 1px solid #2ec5d3;
818
     border: 1px solid #2ec5d3;
824
 }
822
 }
825
 .btn_add_producto span {
823
 .btn_add_producto span {
826
     display: block;
824
     display: block;
827
-    padding: 10px;
825
+    padding: 6px;
828
 }
826
 }
829
 .modal-header {
827
 .modal-header {
830
     display: -ms-flexbox;
828
     display: -ms-flexbox;

+ 24 - 19
src/Pages/Puestos.jsx

18
 
18
 
19
 import { ListMode } from '../Components/Puestos/ListMode'
19
 import { ListMode } from '../Components/Puestos/ListMode'
20
 import { GridMode } from '../Components/Puestos/GridMode'
20
 import { GridMode } from '../Components/Puestos/GridMode'
21
+import { Add as AddIcon, } from '@mui/icons-material/'
21
 
22
 
22
 
23
 
23
 const Success =  () => toast.success('Plaza Agregada!!')
24
 const Success =  () => toast.success('Plaza Agregada!!')
32
         let rest = new Service("/plaza/getall")
33
         let rest = new Service("/plaza/getall")
33
 
34
 
34
         rest
35
         rest
35
-        .get(token)
36
-        .then(({data}) => {
37
-            let entries = data.map( e => {
38
-                return {
39
-                    nombre : e.nombrepuesto,
40
-                    description : e.notas,
41
-                    id : e.id,
42
-                    created: e.create_day,
43
-                    data: e
44
-                };
36
+            .get(token)
37
+            .then(({data}) => {
38
+                let entries = data.map( e => {
39
+                    return {
40
+                        nombre : e.nombrepuesto,
41
+                        description : e.notas,
42
+                        id : e.id,
43
+                        created: e.create_day,
44
+                        data: e
45
+                    };
46
+                })
47
+                setData(entries)
48
+            })
49
+            .catch((error) => {
50
+                console.log('error fetching data  ', error );
45
             })
51
             })
46
-            setData(entries)
47
-        })
48
-        .catch((error) => {
49
-            console.log('error fetching data  ', error );
50
-        })
51
 
52
 
52
     },[token])
53
     },[token])
53
 
54
 
86
         <div className="content-section">
87
         <div className="content-section">
87
             <div className="main">
88
             <div className="main">
88
                 <Box sx={{ width: '100%' }}>
89
                 <Box sx={{ width: '100%' }}>
89
-                    <Paper sx={{ width: '100%', mb: 2, padding : 2 }}>
90
+                    <Paper sx={{ width: '100%', mb: 2, padding : 2, height: '95vh' }}>
90
 
91
 
91
-                        <Row>
92
+                        <Row style={{paddingBottom : 15}}>
92
                             <Col md="2" sm="2" xs="2">
93
                             <Col md="2" sm="2" xs="2">
93
                                 <div className="breadcrumb-header">
94
                                 <div className="breadcrumb-header">
94
                                     <Box sx={{ float : 'left',display: 'flex', flexDirection: 'column', alignItems: 'center', '& > :not(style) + :not(style)': { mt: 2 }, }} >
95
                                     <Box sx={{ float : 'left',display: 'flex', flexDirection: 'column', alignItems: 'center', '& > :not(style) + :not(style)': { mt: 2 }, }} >
100
                             </Col>
101
                             </Col>
101
                             <Col md="10" sm='10' xs="10">
102
                             <Col md="10" sm='10' xs="10">
102
                                 <div className="add_producto">
103
                                 <div className="add_producto">
103
-                                    <div onClick={() => setManual(true) } className="btn_add_producto"> <span >Agregar manual</span> </div>
104
+                                    <div onClick={() => setManual(true) } className="btn_add_producto"> 
105
+                                        <span className="btn_plaza_common" >Agregar manual <AddIcon/></span> 
106
+                                    </div>
104
                                 </div>
107
                                 </div>
105
                                 <div onClick={() => setExpress(true) } className="add_producto">
108
                                 <div onClick={() => setExpress(true) } className="add_producto">
106
-                                    <div className="btn_add_producto"> <span >Agregar express</span> </div>
109
+                                    <div className="btn_add_producto"> 
110
+                                        <span className="btn_plaza_common">Agregar express <AddIcon/></span> 
111
+                                    </div>
107
                                 </div>
112
                                 </div>
108
                             </Col>
113
                             </Col>
109
                         </Row>
114
                         </Row>