|
|
@@ -2,11 +2,14 @@ import { h, Component } from 'preact'; |
|
|
|
import WBBrowseDialogProjectList from 'wb-browse-dialog-project-list';
|
|
|
|
import WBBrowseDialogCollectionList from 'wb-browse-dialog-project-list';
|
|
|
|
import linkState from 'linkstate';
|
|
|
|
import { Router } from 'preact-router';
|
|
|
|
import { createHashHistory } from 'history';
|
|
|
|
|
|
|
|
class WBBrowseDialog extends Component {
|
|
|
|
constructor(...args) {
|
|
|
|
super(...args);
|
|
|
|
this.state.history = [];
|
|
|
|
this.state.history_1 = createHashHistory();
|
|
|
|
}
|
|
|
|
|
|
|
|
resetSearch() {
|
|
|
@@ -17,7 +20,7 @@ class WBBrowseDialog extends Component { |
|
|
|
}
|
|
|
|
|
|
|
|
pushHistory(child) {
|
|
|
|
const { history } = this.state;
|
|
|
|
const { history, textSearch } = this.state;
|
|
|
|
history.push([ child, { textSearch } ]);
|
|
|
|
this.state.history = history.slice(history.length - 1000);
|
|
|
|
}
|
|
|
@@ -30,7 +33,7 @@ class WBBrowseDialog extends Component { |
|
|
|
entry[0].popHistory();
|
|
|
|
}
|
|
|
|
|
|
|
|
render({ app, id }, { mode, textSearch, textSearchInput }) {
|
|
|
|
render({ app, id }, { mode, textSearch, textSearchInput, history, history_1 }) {
|
|
|
|
return (
|
|
|
|
<div class="modal" id={ id } tabindex="-1" role="dialog">
|
|
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
|
@@ -43,6 +46,15 @@ class WBBrowseDialog extends Component { |
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-body">
|
|
|
|
<Router history={ history_1 }>
|
|
|
|
<div path="/a">
|
|
|
|
A
|
|
|
|
</div>
|
|
|
|
<div path="/b">
|
|
|
|
B
|
|
|
|
</div>
|
|
|
|
</Router>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<h5>Go to: <a href="#">Home</a>, <a href="#">All Projects</a>,
|
|
|
|
<a href="#">All Users</a>, <a href="#">Shared with Me</a></h5>
|
|
|
|