@@ -10,6 +10,7 @@ import { connect } from 'react-redux'
1010import { getAllEvents } from '../../actions/eventAction'
1111import { checkDeleteRights } from '../dashboard/utils/checkDeleteRights'
1212import { getOrgProfile } from '../../actions/orgAction'
13+ import { Pagination } from 'antd'
1314import Moment from 'react-moment'
1415import { canEditCheck } from '../projects/Utils/CanEdit'
1516
@@ -32,7 +33,7 @@ class Events extends Component {
3233
3334 componentDidMount ( ) {
3435 setTimeout ( ( ) => {
35- this . props . getAllEvents ( )
36+ this . props . getAllEvents ( ) // by default 6 events per page
3637 this . props . getOrgProfile ( )
3738 } )
3839 }
@@ -50,6 +51,16 @@ class Events extends Component {
5051 } )
5152 }
5253
54+ onShowSizeChange = ( currentPage , pageSize ) => {
55+ console . log ( 'currentPage pageSize ' , currentPage , pageSize )
56+ this . props . getAllEvents ( pageSize , currentPage )
57+ }
58+
59+ handlePagination = ( pageNumber ) => {
60+ console . log ( 'page number ' , pageNumber ) ;
61+ this . props . getAllEvents ( 6 , pageNumber )
62+ }
63+
5364
5465 render ( ) {
5566 const { allEvents, editingLimit } = this . state
@@ -266,6 +277,15 @@ class Events extends Component {
266277 { Events }
267278 </ Grid >
268279 </ div >
280+ < div className = "event__pagination__container" >
281+ < Pagination
282+ showSizeChanger
283+ onShowSizeChange = { this . onShowSizeChange }
284+ defaultCurrent = { 1 }
285+ total = { 100 }
286+ onChange = { this . handlePagination }
287+ />
288+ </ div >
269289 </ div >
270290 < Popups
271291 option = { this . state . option }
0 commit comments