Quellcode durchsuchen

password component

amenpunk vor 2 Jahren
Ursprung
Commit
4a7acfa30e
2 geänderte Dateien mit 52 neuen und 16 gelöschten Zeilen
  1. 29 0
      src/Components/Password/TableStyle.js
  2. 23 16
      src/Pages/ContrasV2.jsx

+ 29 - 0
src/Components/Password/TableStyle.js

@@ -0,0 +1,29 @@
1
+import { createTheme } from '@mui/material';
2
+    
3
+export const TableStyle = () => createTheme({
4
+    components: {
5
+        MuiPaper:{
6
+            styleOverrides: {
7
+                root: {
8
+                    boxShadow:'none'
9
+                }
10
+            }
11
+
12
+        },
13
+        MUIDataTableBodyCell: {
14
+            styleOverrides: {
15
+                root: {
16
+                    backgroundColor: "#FFF"
17
+                }
18
+            }
19
+        },
20
+        MuiTablePagination:{
21
+            styleOverrides: {
22
+                toolbar: {
23
+                    paddingTop :7,
24
+                    alignItems: 'baseline'
25
+                }
26
+            }
27
+        }
28
+    }
29
+})

+ 23 - 16
src/Pages/ContrasV2.jsx

@@ -1,27 +1,30 @@
1 1
 import * as React from 'react';
2 2
 import { default as CustomToolbar } from '../Components/Password/CustomToolbar';
3
-
4
-import {
5
-    Paper, Box,
6
-    // Table, TableBody, TableCell, TableContainer, TableRow, TablePagination, Switch, FormControlLabel, Checkbox,
7
-} from '@mui/material';
3
+import { Paper, Box, ThemeProvider } from '@mui/material';
8 4
 
9 5
 import MUIDataTable from "mui-datatables";
6
+import { encabezados } from '../Components/Password/Rows';
7
+import { TableStyle } from '../Components/Password/TableStyle'
10 8
 
11 9
 export function Contrasv2() {
12 10
 
13
-
14
-
15
-    const columns = ["Name", "Company", "City", "State"];
11
+    const columns = encabezados.map(({ label }) => label); //["Name", "Company", "City", "State"];
16 12
 
17 13
     const data = [
18 14
         ["Joe James", "Test Corp", "Yonkers", "NY"],
19 15
         ["John Walsh", "Test Corp", "Hartford", "CT"],
20 16
         ["Bob Herm", "Test Corp", "Tampa", "FL"],
21 17
         ["James Houston", "Test Corp", "Dallas", "TX"],
18
+        ["Joe James", "Test Corp", "Yonkers", "NY"],
19
+        ["John Walsh", "Test Corp", "Hartford", "CT"],
20
+        ["Bob Herm", "Test Corp", "Tampa", "FL"],
21
+        ["James Houston", "Test Corp", "Dallas", "TX"],
22
+        ["Joe James", "Test Corp", "Yonkers", "NY"],
23
+        ["John Walsh", "Test Corp", "Hartford", "CT"],
24
+        ["Bob Herm", "Test Corp", "Tampa", "FL"],
25
+        ["James Houston", "Test Corp", "Dallas", "TX"],
22 26
     ];
23 27
 
24
-
25 28
     const options = {
26 29
         filterType: 'checkbox',
27 30
         customToolbar: () => {
@@ -31,17 +34,21 @@ export function Contrasv2() {
31 34
         }
32 35
     };
33 36
 
37
+
34 38
     return (
35 39
         <div className="content-section">
36 40
             <div className="main">
37 41
                 <Box sx={{ width: '100%' }}>
38
-                    <Paper sx={{ mb: 2, padding: 2, height: '100%', minHeight: '95vh' }}>
39
-                        <MUIDataTable
40
-                            title={"Contraseñas"}
41
-                            data={data}
42
-                            columns={columns}
43
-                            options={options}
44
-                        />
42
+                    <Paper elevation={0} sx={{ mb: 2, padding: 2, height: '100%', minHeight: '95vh', boxShadow: 'none !important' }}>
43
+                        <ThemeProvider theme={TableStyle}>
44
+                            <MUIDataTable
45
+                                sx={{ '& MuiPaper': { elevation: 0, boxShadow: 'none', color: "red" } }}
46
+                                title={"Contraseñas"}
47
+                                data={data}
48
+                                columns={columns}
49
+                                options={options}
50
+                            />
51
+                        </ThemeProvider>
45 52
                     </Paper>
46 53
                 </Box>
47 54
             </div>