|
123456789101112131415161718192021222324252627282930 |
- import { h, Component } from 'preact';
- import { route } from 'preact-router';
- import WBNavbarCommon from 'wb-navbar-common';
- import WBUserListing from 'wb-user-listing';
-
- class WBUsersPage extends Component {
- getUrl(params) {
- const url = '/users/' +
- Number('page' in params ? params.page : (this.props.page || 0)) + '/' +
- encodeURIComponent('textSearch' in params ? params.textSearch : (this.props.textSearch || ''));
- return url;
- // return ('/users/' + page);
- }
-
- render({ app, page, textSearch }) {
- return (
- <div>
- <WBNavbarCommon app={ app } activeItem="all-users"
- textSearch={ textSearch }
- textSearchNavigate={ textSearch => route(this.getUrl({ textSearch, page: 0 })) } />
-
- <WBUserListing app={ app } page={ Number(page || 0) }
- textSearch={ textSearch }
- getPageUrl={ page => this.getUrl({ page }) } />
- </div>
- );
- }
- };
-
- export default WBUsersPage;
|