|
@@ -1,107 +1,167 @@
|
1
|
|
-const SectionStyle = styled(Card)(({ theme }) => ({
|
2
|
|
- width: '100%',
|
3
|
|
- maxWidth: 464,
|
4
|
|
- display: 'flex',
|
5
|
|
- flexDirection: 'column',
|
6
|
|
- justifyContent: 'center',
|
7
|
|
- margin: theme.spacing(2, 0, 2, 2)
|
8
|
|
-}));
|
|
1
|
+import * as React from 'react';
|
|
2
|
+import PropTypes from 'prop-types';
|
|
3
|
+import { useTheme } from '@mui/material/styles';
|
|
4
|
+import Box from '@mui/material/Box';
|
|
5
|
+import Table from '@mui/material/Table';
|
|
6
|
+import TableBody from '@mui/material/TableBody';
|
|
7
|
+import TableCell from '@mui/material/TableCell';
|
|
8
|
+import TableContainer from '@mui/material/TableContainer';
|
|
9
|
+import TableFooter from '@mui/material/TableFooter';
|
|
10
|
+import TablePagination from '@mui/material/TablePagination';
|
|
11
|
+import TableRow from '@mui/material/TableRow';
|
|
12
|
+import Paper from '@mui/material/Paper';
|
|
13
|
+import IconButton from '@mui/material/IconButton';
|
|
14
|
+import FirstPageIcon from '@mui/icons-material/FirstPage';
|
|
15
|
+import KeyboardArrowLeft from '@mui/icons-material/KeyboardArrowLeft';
|
|
16
|
+import KeyboardArrowRight from '@mui/icons-material/KeyboardArrowRight';
|
|
17
|
+import LastPageIcon from '@mui/icons-material/LastPage';
|
9
|
18
|
|
10
|
|
-const ContentStyle = styled('div')(({ theme }) => ({
|
11
|
|
- maxWidth: 480,
|
12
|
|
- margin: 'auto',
|
13
|
|
- display: 'flex',
|
14
|
|
- minHeight: '100vh',
|
15
|
|
- flexDirection: 'column',
|
16
|
|
- justifyContent: 'center',
|
17
|
|
- padding: theme.spacing(12, 0)
|
18
|
|
-}));
|
|
19
|
+function TablePaginationActions(props) {
|
|
20
|
+ const theme = useTheme();
|
|
21
|
+ const { count, page, rowsPerPage, onPageChange } = props;
|
19
|
22
|
|
20
|
|
-const RootStyle = styled(Page)(({ theme }) => ({
|
21
|
|
- [theme.breakpoints.up('md')]: {
|
22
|
|
- display: 'flex'
|
23
|
|
- }
|
24
|
|
-}));
|
|
23
|
+ const handleFirstPageButtonClick = (event) => {
|
|
24
|
+ onPageChange(event, 0);
|
|
25
|
+ };
|
25
|
26
|
|
26
|
|
-function temp () {
|
27
|
|
- return(
|
28
|
|
- <RootStyle title="Register | Minimal-UI">
|
|
27
|
+ const handleBackButtonClick = (event) => {
|
|
28
|
+ onPageChange(event, page - 1);
|
|
29
|
+ };
|
29
|
30
|
|
30
|
|
- <AuthLayout>
|
31
|
|
- Ya tiene una cuenta?
|
32
|
|
- <Link to="/login" component={RouterLink}>
|
33
|
|
- Ingresa
|
34
|
|
- </Link>
|
35
|
|
- </AuthLayout>
|
|
31
|
+ const handleNextButtonClick = (event) => {
|
|
32
|
+ onPageChange(event, page + 1);
|
|
33
|
+ };
|
36
|
34
|
|
37
|
|
- <SectionStyle>
|
38
|
|
- <Typography variant="h3" sx={{ px: 5, mt: 10, mb: 5 }}>
|
39
|
|
- Efectividad para tus procesos de reclutamiento
|
40
|
|
- </Typography>
|
41
|
|
- <img alt="register" src={Mock} />
|
42
|
|
- </SectionStyle>
|
|
35
|
+ const handleLastPageButtonClick = (event) => {
|
|
36
|
+ onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
|
|
37
|
+ };
|
43
|
38
|
|
44
|
|
- <Container>
|
45
|
|
- <ContentStyle>
|
46
|
|
- <Box sx={{ mb: 5 }}>
|
47
|
|
- <Typography variant="h4" gutterBottom>
|
48
|
|
- Empieza de forma gratuita.
|
49
|
|
- </Typography>
|
50
|
|
- <Typography sx={{ color: 'text.secondary' }}>
|
51
|
|
- Gratis para siempre. No se necesita tarjeta de crédito.
|
52
|
|
- </Typography>
|
53
|
|
- </Box>
|
|
39
|
+ return (
|
|
40
|
+ <Box sx={{ flexShrink: 0, ml: 2.5 }}>
|
|
41
|
+ <IconButton
|
|
42
|
+ onClick={handleFirstPageButtonClick}
|
|
43
|
+ disabled={page === 0}
|
|
44
|
+ aria-label="first page"
|
|
45
|
+ >
|
|
46
|
+ {theme.direction === 'rtl' ? <LastPageIcon /> : <FirstPageIcon />}
|
|
47
|
+ </IconButton>
|
|
48
|
+ <IconButton
|
|
49
|
+ onClick={handleBackButtonClick}
|
|
50
|
+ disabled={page === 0}
|
|
51
|
+ aria-label="previous page"
|
|
52
|
+ >
|
|
53
|
+ {theme.direction === 'rtl' ? <KeyboardArrowRight /> : <KeyboardArrowLeft />}
|
|
54
|
+ </IconButton>
|
|
55
|
+ <IconButton
|
|
56
|
+ onClick={handleNextButtonClick}
|
|
57
|
+ disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
|
58
|
+ aria-label="next page"
|
|
59
|
+ >
|
|
60
|
+ {theme.direction === 'rtl' ? <KeyboardArrowLeft /> : <KeyboardArrowRight />}
|
|
61
|
+ </IconButton>
|
|
62
|
+ <IconButton
|
|
63
|
+ onClick={handleLastPageButtonClick}
|
|
64
|
+ disabled={page >= Math.ceil(count / rowsPerPage) - 1}
|
|
65
|
+ aria-label="last page"
|
|
66
|
+ >
|
|
67
|
+ {theme.direction === 'rtl' ? <FirstPageIcon /> : <LastPageIcon />}
|
|
68
|
+ </IconButton>
|
|
69
|
+ </Box>
|
|
70
|
+ );
|
|
71
|
+}
|
|
72
|
+
|
|
73
|
+TablePaginationActions.propTypes = {
|
|
74
|
+ count: PropTypes.number.isRequired,
|
|
75
|
+ onPageChange: PropTypes.func.isRequired,
|
|
76
|
+ page: PropTypes.number.isRequired,
|
|
77
|
+ rowsPerPage: PropTypes.number.isRequired,
|
|
78
|
+};
|
|
79
|
+
|
|
80
|
+function createData(name, calories, fat) {
|
|
81
|
+ return { name, calories, fat };
|
|
82
|
+}
|
|
83
|
+
|
|
84
|
+const rows = [
|
|
85
|
+ createData('Cupcake', 305, 3.7),
|
|
86
|
+ createData('Donut', 452, 25.0),
|
|
87
|
+ createData('Eclair', 262, 16.0),
|
|
88
|
+ createData('Frozen yoghurt', 159, 6.0),
|
|
89
|
+ createData('Gingerbread', 356, 16.0),
|
|
90
|
+ createData('Honeycomb', 408, 3.2),
|
|
91
|
+ createData('Ice cream sandwich', 237, 9.0),
|
|
92
|
+ createData('Jelly Bean', 375, 0.0),
|
|
93
|
+ createData('KitKat', 518, 26.0),
|
|
94
|
+ createData('Lollipop', 392, 0.2),
|
|
95
|
+ createData('Marshmallow', 318, 0),
|
|
96
|
+ createData('Nougat', 360, 19.0),
|
|
97
|
+ createData('Oreo', 437, 18.0),
|
|
98
|
+].sort((a, b) => (a.calories < b.calories ? -1 : 1));
|
|
99
|
+
|
|
100
|
+export default function CustomPaginationActionsTable() {
|
|
101
|
+ const [page, setPage] = React.useState(0);
|
|
102
|
+ const [rowsPerPage, setRowsPerPage] = React.useState(5);
|
|
103
|
+
|
|
104
|
+ // Avoid a layout jump when reaching the last page with empty rows.
|
|
105
|
+ const emptyRows =
|
|
106
|
+ page > 0 ? Math.max(0, (1 + page) * rowsPerPage - rows.length) : 0;
|
54
|
107
|
|
55
|
|
- <Stepper activeStep={activeStep} orientation="vertical">
|
56
|
|
- {steps.map((step, index) => (
|
57
|
|
- <Step key={step.label}>
|
58
|
|
- <StepLabel
|
59
|
|
- optional={
|
60
|
|
- index === 2 ? (
|
61
|
|
- <Typography variant="caption">Last step</Typography>
|
62
|
|
- ) : null
|
63
|
|
- }
|
64
|
|
- >
|
65
|
|
- {step.label}
|
66
|
|
- </StepLabel>
|
67
|
|
- <StepContent style={{ padding: 25 }}>
|
68
|
|
- {step.description}
|
69
|
|
- </StepContent>
|
70
|
|
- </Step>
|
71
|
|
- ))}
|
72
|
|
- </Stepper>
|
73
|
|
- {activeStep === steps.length && (
|
74
|
|
- <Paper square elevation={0} sx={{ p: 3 }}>
|
75
|
|
- <Typography>All steps completed - you're finished</Typography>
|
76
|
|
- <Button onClick={handleReset} sx={{ mt: 1, mr: 1 }}>
|
77
|
|
- Reset
|
78
|
|
- </Button>
|
79
|
|
- </Paper>
|
80
|
|
- )}
|
|
108
|
+ const handleChangePage = (event, newPage) => {
|
|
109
|
+ setPage(newPage);
|
|
110
|
+ };
|
81
|
111
|
|
82
|
|
- <Typography variant="body2" align="center" sx={{ color: 'text.secondary', mt: 3 }}>
|
83
|
|
- Estoy de acuerdo con las {" "}
|
84
|
|
- <Link underline="always" sx={{ color: "#d32f2f" }}>
|
85
|
|
- Condiciones de servicio
|
86
|
|
- </Link>
|
87
|
|
- {" "}y{" "}
|
88
|
|
- <Link underline="always" sx={{ color: "#d32f2f" }}>
|
89
|
|
- Política de privacidad
|
90
|
|
- </Link>
|
91
|
|
- .
|
92
|
|
- </Typography>
|
|
112
|
+ const handleChangeRowsPerPage = (event) => {
|
|
113
|
+ setRowsPerPage(parseInt(event.target.value, 10));
|
|
114
|
+ setPage(0);
|
|
115
|
+ };
|
93
|
116
|
|
94
|
|
- <div>
|
95
|
|
- <Typography variant="subtitle2" sx={{ mt: 3, textAlign: 'center' }}>
|
96
|
|
- Ya tiene una cuenta?
|
97
|
|
- <Link to="/login" component={RouterLink}>
|
98
|
|
- Ingresa
|
99
|
|
- </Link>
|
100
|
|
- </Typography>
|
101
|
|
- </div>
|
102
|
|
- </ContentStyle>
|
|
117
|
+ return (
|
|
118
|
+ <TableContainer component={Paper}>
|
|
119
|
+ <Table sx={{ minWidth: 500 }} aria-label="custom pagination table">
|
|
120
|
+ <TableBody>
|
|
121
|
+ {(rowsPerPage > 0
|
|
122
|
+ ? rows.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
|
|
123
|
+ : rows
|
|
124
|
+ ).map((row) => (
|
|
125
|
+ <TableRow key={row.name}>
|
|
126
|
+ <TableCell component="th" scope="row">
|
|
127
|
+ {row.name}
|
|
128
|
+ </TableCell>
|
|
129
|
+ <TableCell style={{ width: 160 }} align="right">
|
|
130
|
+ {row.calories}
|
|
131
|
+ </TableCell>
|
|
132
|
+ <TableCell style={{ width: 160 }} align="right">
|
|
133
|
+ {row.fat}
|
|
134
|
+ </TableCell>
|
|
135
|
+ </TableRow>
|
|
136
|
+ ))}
|
103
|
137
|
|
104
|
|
- </Container>
|
105
|
|
- </RootStyle>
|
106
|
|
- )
|
|
138
|
+ {emptyRows > 0 && (
|
|
139
|
+ <TableRow style={{ height: 53 * emptyRows }}>
|
|
140
|
+ <TableCell colSpan={6} />
|
|
141
|
+ </TableRow>
|
|
142
|
+ )}
|
|
143
|
+ </TableBody>
|
|
144
|
+ <TableFooter>
|
|
145
|
+ <TableRow>
|
|
146
|
+ <TablePagination
|
|
147
|
+ rowsPerPageOptions={[5, 10, 25, { label: 'All', value: -1 }]}
|
|
148
|
+ colSpan={3}
|
|
149
|
+ count={rows.length}
|
|
150
|
+ rowsPerPage={rowsPerPage}
|
|
151
|
+ page={page}
|
|
152
|
+ SelectProps={{
|
|
153
|
+ inputProps: {
|
|
154
|
+ 'aria-label': 'rows per page',
|
|
155
|
+ },
|
|
156
|
+ native: true,
|
|
157
|
+ }}
|
|
158
|
+ onPageChange={handleChangePage}
|
|
159
|
+ onRowsPerPageChange={handleChangeRowsPerPage}
|
|
160
|
+ ActionsComponent={TablePaginationActions}
|
|
161
|
+ />
|
|
162
|
+ </TableRow>
|
|
163
|
+ </TableFooter>
|
|
164
|
+ </Table>
|
|
165
|
+ </TableContainer>
|
|
166
|
+ );
|
107
|
167
|
}
|