File tree 2 files changed +35
-40
lines changed
2 files changed +35
-40
lines changed Original file line number Diff line number Diff line change @@ -2,23 +2,6 @@ import { PaginationStyled } from './Pagination.styled';
2
2
import { PaginationItem } from '@mui/material' ;
3
3
import { Link } from 'react-router-dom' ;
4
4
import { useLocation } from 'react-router-dom' ;
5
- import { createTheme , ThemeProvider } from '@mui/material/styles' ;
6
-
7
- const theme = createTheme ( {
8
- status : {
9
- danger : '#e53e3e' ,
10
- } ,
11
- palette : {
12
- primary : {
13
- main : '#f59256' ,
14
- darker : '#053e85' ,
15
- } ,
16
- neutral : {
17
- main : '#64748B' ,
18
- contrastText : '#fff' ,
19
- } ,
20
- } ,
21
- } ) ;
22
5
23
6
export const PaginationComponent = ( { paginateData } ) => {
24
7
const { setPage, totalPage, page, titleRequest } = paginateData ;
@@ -30,28 +13,26 @@ export const PaginationComponent = ({ paginateData }) => {
30
13
} ;
31
14
32
15
return (
33
- < ThemeProvider theme = { theme } >
34
- < PaginationStyled
35
- count = { totalPage }
36
- siblingCount = { 0 }
37
- onChange = { ( _ , num ) => {
38
- setPage ( num ) ;
39
- scrollToTop ( num ) ;
40
- } }
41
- size = "large"
42
- color = "primary"
43
- page = { page }
44
- renderItem = { item => (
45
- < PaginationItem
46
- component = { Link }
47
- to = {
48
- `${ pathname } ?page=${ item . page } ` +
49
- ( titleRequest !== '' ? `&search=${ titleRequest } ` : '' )
50
- }
51
- { ...item }
52
- />
53
- ) }
54
- />
55
- </ ThemeProvider >
16
+ < PaginationStyled
17
+ variant = "outlined"
18
+ count = { totalPage }
19
+ siblingCount = { 0 }
20
+ onChange = { ( _ , num ) => {
21
+ setPage ( num ) ;
22
+ scrollToTop ( num ) ;
23
+ } }
24
+ size = "large"
25
+ page = { page }
26
+ renderItem = { item => (
27
+ < PaginationItem
28
+ component = { Link }
29
+ to = {
30
+ `${ pathname } ?page=${ item . page } ` +
31
+ ( titleRequest !== '' ? `&search=${ titleRequest } ` : '' )
32
+ }
33
+ { ...item }
34
+ />
35
+ ) }
36
+ />
56
37
) ;
57
38
} ;
Original file line number Diff line number Diff line change @@ -6,4 +6,18 @@ export const PaginationStyled = styled(Pagination)`
6
6
align-items: center;
7
7
justify-content: center;
8
8
margin-top: 90px;
9
+ .Mui-selected {
10
+ background-color: #f59256 !important;
11
+ color: #ffffff !important;
12
+ }
13
+
14
+ .MuiPaginationItem-root {
15
+ border: 2px solid #f59256;
16
+ color: #f59256;
17
+ &:hover {
18
+ background-color: #f59256;
19
+ color: #ffffff;
20
+ cursor: pointer;
21
+ }
22
+ }
9
23
` ;
You can’t perform that action at this time.
0 commit comments