mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 17:02:47 +00:00
Repair router compatibility (#2562)
This commit is contained in:
@@ -1,30 +1,16 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import CommonToolbar from './toolbar/common-toolbar';
|
||||
|
||||
const propTypes = {
|
||||
children: PropTypes.object.isRequired,
|
||||
onShowSidePanel: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
class MainPanel extends Component {
|
||||
|
||||
onSearchedClick = () => {
|
||||
//todos;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="main-panel o-hidden">
|
||||
<div className="main-panel-north">
|
||||
<div className="cur-view-toolbar">
|
||||
<span className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none" title="Side Nav Menu" onClick={this.props.onShowSidePanel}></span>
|
||||
</div>
|
||||
<CommonToolbar onSearchedClick={this.onSearchedClick} searchPlaceholder={'Search Files'}/>
|
||||
</div>
|
||||
<div className="main-panel-center">
|
||||
{this.props.children}
|
||||
</div>
|
||||
{this.props.children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
35
frontend/src/components/toolbar/general-toolbar.js
Normal file
35
frontend/src/components/toolbar/general-toolbar.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import React, { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import CommonToolbar from './common-toolbar';
|
||||
|
||||
const propTypes = {
|
||||
onShowSidePanel: PropTypes.func.isRequired,
|
||||
onSearchedClick: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
class GeneralToolbar extends React.Component {
|
||||
|
||||
render() {
|
||||
let { onShowSidePanel, onSearchedClick } = this.props;
|
||||
let placeHolder = this.props.searchPlaceholder || 'Search files in this library';
|
||||
return (
|
||||
<Fragment>
|
||||
<div className="cur-view-toolbar">
|
||||
<span
|
||||
className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none"
|
||||
title="Side Nav Menu"
|
||||
onClick={onShowSidePanel}>
|
||||
</span>
|
||||
</div>
|
||||
<CommonToolbar
|
||||
searchPlaceholder={placeHolder}
|
||||
onSearchedClick={onSearchedClick}
|
||||
/>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
GeneralToolbar.propTypes = propTypes;
|
||||
|
||||
export default GeneralToolbar;
|
Reference in New Issue
Block a user