Skip to content

Commit c380b28

Browse files
KRRISH96rishichawda
authored andcommitted
fix(pagination): update pagination design (#303)
* fix(pagination): fix width and add animations #287
1 parent abfeb5d commit c380b28

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

doc/src/components/common/componentData/Pagination/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ export const componentData = {
7878
name: 'dots',
7979
description: 'Class used for displaying dots between ends and current portion.',
8080
},
81+
{
82+
name: 'withNavigation',
83+
description: 'Class used for controlling width of component when navigation buttons are present.',
84+
},
85+
{
86+
name: 'noNavigation',
87+
description: 'Class used for controlling width of component when navigation buttons are not present.',
88+
},
8189
],
8290
basicComponent: `
8391
<Pagination total={10}/>

lib/pagination/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ class Pagination extends Component {
114114
const { currentActive } = this.state;
115115

116116
const rootProps = {
117-
className: classnames(theme['pagination-wrapper'], className),
117+
className: classnames(
118+
theme['pagination-wrapper'],
119+
navigationButtons ? theme.withNavigation : theme.noNavigation,
120+
className,
121+
),
118122
};
119123

120124
const paginationProps = {

lib/pagination/theme.module.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import '../globals/animations.module.scss';
2+
13
:local(.pagination) {
24
display: grid;
35
grid-auto-flow: column;
@@ -16,12 +18,21 @@
1618
width: fit-content;
1719
flex-flow: row;
1820
align-items: center;
21+
justify-content: space-between;
1922
flex-direction: row;
2023
box-sizing: border-box;
2124
min-height: fit-content;
2225
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
2326
}
2427

28+
:local(.noNavigation) {
29+
width: 262px;
30+
justify-content: center;
31+
}
32+
:local(.withNavigation) {
33+
width: 332px;
34+
}
35+
2536
:local(.pagination-steps) {
2637
display: flex;
2738
align-items: center;
@@ -37,6 +48,9 @@
3748
cursor: pointer;
3849
padding: 1em;
3950
margin: 1px;
51+
@include zoomIn();
52+
animation-duration: 0.2s;
53+
animation-timing-function: ease-in;
4054
}
4155

4256
:local(.active) {
@@ -51,6 +65,9 @@
5165
height: 100%;
5266
align-items: center;
5367
margin: 0 0.2em;
68+
@include zoomIn();
69+
animation-duration: 0.2s;
70+
animation-timing-function: ease-in;
5471
span {
5572
height: 0.5em;
5673
width: 0.5em;

0 commit comments

Comments
 (0)