MCPcopy Create free account
hub / github.com/flyfloor/react-component / PaginationDemo

Class PaginationDemo

demo/example/PaginationDemo.jsx:4–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import {Pagination} from './index.js';
3
4export default class PaginationDemo extends React.Component {
5 constructor(props){
6 super(props);
7 this.state = {
8 current: 6,
9 };
10 }
11
12 handlePageChange(page){
13 this.setState({
14 current: page
15 });
16 }
17
18 render() {
19 return (
20 <div>
21 <h3>Pagination</h3>
22 <ol>
23 <li>
24 <h4>Default pagination</h4>
25 <Pagination/>
26 <pre>
27 <code>
28 {`<Pagination/>`}
29 </code>
30 </pre>
31 </li>
32 <li>
33 <h4>Change event</h4>
34 <p>this will change next pagination</p>
35 <Pagination total={10} onChange={this.handlePageChange.bind(this)}/>
36 <pre>
37 <code>
38 {`<Pagination total={10} onChange={handlePageChange}/>`}
39 </code>
40 </pre>
41 </li>
42 <li>
43 <h4>Pagination with given current page</h4>
44 <p>now on page {this.state.current}</p>
45 <Pagination current={this.state.current} onChange={this.handlePageChange.bind(this)} total={100}/>
46 <pre>
47 <code>
48 {`<Pagination current={current} onChange={handlePageChange} total={100}/>`}
49 </code>
50 </pre>
51 </li>
52 <li>
53 <h4>Pagination with full range</h4>
54 <Pagination showRange={true} total={100}/>
55 <pre>
56 <code>
57 {`<Pagination showRange={true} total={100}/>`}
58 </code>
59 </pre>
60 </li>
61 <li>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…