|
12345678910111213141516171819202122232425262728293031323334353637 |
- //
- // Copyright (C) Stanislaw Adaszewski, 2020
- // Contact: s.adaszewski@gmail.com
- // Website: https://adared.ch/wba
- // License: GPLv3
- //
-
- 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;
|