1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 01:12:03 +00:00

Add option to only show folder in nav side panel (#6541)

* fix conflict

* remove redundant code

* add space at the end of css

* update ui
This commit is contained in:
Aries
2024-08-16 11:59:07 +08:00
committed by GitHub
parent 7543f195f3
commit 0d740cf138
9 changed files with 95 additions and 10 deletions

View File

@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
import { Dropdown, DropdownMenu, DropdownToggle, DropdownItem } from 'reactstrap';
import { gettext } from '../utils/constants';
import '../css/view-modes.css';
const propTypes = {
currentViewMode: PropTypes.string.isRequired,
switchViewMode: PropTypes.func.isRequired
@@ -51,15 +53,15 @@ class ViewModes extends React.Component {
<DropdownMenu right={true} className="mt-1">
{options.map((item, index) => {
return (
<DropdownItem key={index} onClick={this.props.switchViewMode.bind(this, item.value)}>
<div className="d-flex justify-content-between align-items-center">
<span className="mr-8 d-flex justify-content-between align-items-center">
<DropdownItem className='p-0' key={index} onClick={this.props.switchViewMode.bind(this, item.value)}>
<div className="view-modes-dropdown-wrapper">
<span className='view-modes-dropdown-tick'>
{currentViewMode === item.value && <i className="sf2-icon-tick"></i>}
</span>
<span className="view-modes-dropdown-content">
<span className={`sf3-font-${item.icon} sf3-font mr-2`}></span>
<span>{item.text}</span>
</span>
<span>
{currentViewMode === item.value && <i className="sf2-icon-tick"></i>}
</span>
</div>
</DropdownItem>
);