mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
My librarys (#2584)
This commit is contained in:
@@ -16,6 +16,8 @@ import ShareAdminFolders from './pages/share-admin/folders';
|
||||
import ShareAdminShareLinks from './pages/share-admin/share-links';
|
||||
import ShareAdminUploadLinks from './pages/share-admin/upload-links';
|
||||
import SharedLibraries from './pages/shared-libs/shared-libs';
|
||||
import MyLibraries from './pages/my-libs/my-libs';
|
||||
import DirView from './components/dir-view/dir-view';
|
||||
import MainContentWrapper from './components/main-content-wrapper';
|
||||
|
||||
import 'seafile-ui';
|
||||
@@ -48,6 +50,7 @@ class App extends Component {
|
||||
isLoadingDraft: true,
|
||||
currentTab: 'dashboard',
|
||||
};
|
||||
this.currentTab = ''; //just for refresh brower
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
@@ -56,9 +59,10 @@ class App extends Component {
|
||||
// TODO: need refactor later
|
||||
let href = window.location.href.split('/');
|
||||
this.getDrafts();
|
||||
this.setState({
|
||||
currentTab: href[href.length - 2]
|
||||
});
|
||||
this.setState({currentTab: href[href.length - 2]});
|
||||
if (this.currentTab) {
|
||||
this.setState({currentTab: this.currentTab});
|
||||
}
|
||||
}
|
||||
|
||||
getDrafts = () => {
|
||||
@@ -94,12 +98,14 @@ class App extends Component {
|
||||
//todos
|
||||
}
|
||||
|
||||
tabItemClick = (param) => {
|
||||
this.setState({
|
||||
currentTab: param
|
||||
});
|
||||
tabItemClick = (tabName) => {
|
||||
this.setState({currentTab: tabName});
|
||||
}
|
||||
|
||||
updateCurrentTab = (tabName) => {
|
||||
this.currentTab = tabName;
|
||||
}
|
||||
|
||||
render() {
|
||||
let { currentTab } = this.state;
|
||||
return (
|
||||
@@ -131,6 +137,8 @@ class App extends Component {
|
||||
<ShareAdminShareLinksWrapper path={siteRoot + 'share-admin-share-links'} onShowSidePanel={this.onShowSidePanel} onSearchedClick={this.onSearchedClick} />
|
||||
<ShareAdminUploadLinksWrapper path={siteRoot + 'share-admin-upload-links'} onShowSidePanel={this.onShowSidePanel} onSearchedClick={this.onSearchedClick} />
|
||||
<SharedLibrariesWrapper path={siteRoot + 'shared-libs'} onShowSidePanel={this.onShowSidePanel} onSearchedClick={this.onSearchedClick} />
|
||||
<MyLibraries path={siteRoot + 'my-libs'} onShowSidePanel={this.onShowSidePanel} onSearchedClick={this.onSearchedClick} />
|
||||
<DirView path={siteRoot + 'library/:repoID/*'} onMenuClick={this.onShowSidePanel} updateCurrentTab={this.updateCurrentTab}/>
|
||||
</Router>
|
||||
</MainPanel>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user