-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Slimmer pagination look / feel (#380)
Pagination is now less heavy and also has a compressed view that only shows next / prev buttons.
- Loading branch information
Showing
12 changed files
with
140 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React, { | ||
Component, | ||
} from 'react'; | ||
|
||
import { | ||
EuiPagination, | ||
} from '../../../../src/components'; | ||
|
||
export default class extends Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.state = { | ||
activePage: 0 | ||
}; | ||
|
||
this.PAGE_COUNT = 4; | ||
} | ||
|
||
goToPage = pageNumber => { | ||
this.setState({ | ||
activePage: pageNumber, | ||
}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<EuiPagination | ||
pageCount={this.PAGE_COUNT} | ||
activePage={this.state.activePage} | ||
onPageClick={this.goToPage} | ||
compressed | ||
/> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,6 +177,7 @@ export { | |
|
||
export { | ||
EuiPagination, | ||
EuiPaginationButton, | ||
} from './pagination'; | ||
|
||
export { | ||
|
75 changes: 1 addition & 74 deletions
75
src/components/pagination/__snapshots__/pagination.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`EuiPagination is rendered 1`] = ` | ||
<div | ||
aria-label="aria-label" | ||
class="euiPagination testClass1 testClass2" | ||
data-test-subj="test subject string" | ||
> | ||
<button | ||
class="euiButtonEmpty euiButtonEmpty--text euiButtonEmpty--small euiPaginationButton" | ||
type="button" | ||
> | ||
<span | ||
class="euiButtonEmpty__content" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
class="euiIcon euiButtonEmpty__icon euiIcon--medium" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xlink="http://www.w3.org/1999/xlink" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<defs> | ||
<path | ||
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z" | ||
id="arrow_left-a" | ||
/> | ||
</defs> | ||
<use | ||
fill-rule="nonzero" | ||
href="#arrow_left-a" | ||
transform="rotate(90 8 8)" | ||
/> | ||
</svg> | ||
<span> | ||
Previous | ||
</span> | ||
</span> | ||
</button> | ||
<button | ||
class="euiButtonEmpty euiButtonEmpty--text euiButtonEmpty--small euiButtonEmpty--iconRight euiPaginationButton" | ||
type="button" | ||
> | ||
<span | ||
class="euiButtonEmpty__content" | ||
> | ||
<svg | ||
aria-hidden="true" | ||
class="euiIcon euiButtonEmpty__icon euiIcon--medium" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xlink="http://www.w3.org/1999/xlink" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<defs> | ||
<path | ||
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z" | ||
id="arrow_right-a" | ||
/> | ||
</defs> | ||
<use | ||
fill-rule="nonzero" | ||
href="#arrow_right-a" | ||
transform="matrix(0 1 1 0 0 0)" | ||
/> | ||
</svg> | ||
<span> | ||
Next | ||
</span> | ||
</span> | ||
</button> | ||
</div> | ||
`; | ||
exports[`EuiPagination is rendered 1`] = `<span />`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export { | ||
EuiPagination, | ||
} from './pagination'; | ||
|
||
export { | ||
EuiPaginationButton, | ||
} from './pagination_button'; |
Oops, something went wrong.