Guest User

Untitled

a guest
Jun 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import ReactDOM from 'react-dom';
  3.  
  4. import Base from 'terra-base';
  5. import Button from 'terra-button';
  6. import ProgressivePaginator from 'terra-paginator/lib/ProgressivePaginator';
  7.  
  8. class App extends Component {
  9. constructor(props) {
  10. super(props);
  11.  
  12. this.onPageChange = this.onPageChange.bind(this);
  13. this.reduce = this.reduce.bind(this);
  14.  
  15. this.state = {
  16. selectedPage: 1,
  17. itemCountPerPage: 10,
  18. totalCount: 30,
  19. };
  20. }
  21.  
  22. onPageChange() {
  23. // doesn't really matter what is in here
  24. }
  25.  
  26. reduce() {
  27. // Change from the service made the total count of the list 1
  28. this.setState({ totalCount: 5, selectedPage: 1 });
  29. }
  30.  
  31. render() {
  32. return (
  33. <Base>
  34. <Button
  35. variant="emphasis"
  36. text="Change the paginator"
  37. onClick={this.reduce}
  38. />
  39. <ProgressivePaginator
  40. itemCountPerPage={this.state.itemCountPerPage}
  41. onPageChange={this.onPageChange}
  42. selectedPage={this.state.selectedPage}
  43. totalCount={this.state.totalCount}
  44. />
  45. </Base>
  46. );
  47. }
  48. }
Add Comment
Please, Sign In to add comment