1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 17:33:18 +00:00

change wiki and invitation pages add icon (#7457)

This commit is contained in:
Michael An
2025-02-12 13:44:09 +08:00
committed by GitHub
parent 24147256b4
commit 8504134ad6
5 changed files with 35 additions and 61 deletions

View File

@@ -1,10 +1,11 @@
import React, { Fragment } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
import '../../css/single-dropdown-toolbar.css';
const propTypes = {
withPlusIcon: PropTypes.bool,
opList: PropTypes.array.isRequired
};
@@ -37,36 +38,32 @@ class SingleDropdownToolbar extends React.Component {
const { opList, withPlusIcon = false } = this.props;
return (
<Fragment>
<Dropdown isOpen={this.state.isDropdownMenuOpen} toggle={this.toggleDropdownMenu}>
<DropdownToggle
tag="span"
role="button"
className={withPlusIcon ? 'ml-2 sf-dropdown-combined-toggle' : 'ml-1 sf-dropdown-toggle'}
onClick={this.toggleDropdownMenu}
onKeyDown={this.onDropdownToggleKeyDown}
data-toggle="dropdown"
>
{withPlusIcon
? (<><i className="sf3-font-new sf3-font main-icon"></i><i className="sf3-font-down sf3-font"></i></>)
: <i className="sf3-font-down sf3-font"></i>
<Dropdown isOpen={this.state.isDropdownMenuOpen} toggle={this.toggleDropdownMenu} direction="down">
<DropdownToggle
tag="span"
role="button"
className={withPlusIcon ? 'ml-2 sf-dropdown-combined-toggle' : 'ml-1 sf-dropdown-toggle'}
onClick={this.toggleDropdownMenu}
onKeyDown={this.onDropdownToggleKeyDown}
data-toggle="dropdown"
>
{withPlusIcon && <i className="sf3-font-new sf3-font main-icon"></i>}
<i className="sf3-font-down sf3-font"></i>
</DropdownToggle>
<DropdownMenu positionFixed={true}>
{opList.map((item, index) => {
if (item == 'Divider') {
return <DropdownItem key={index} divider />;
} else {
return (
<DropdownItem key={index} onClick={item.onClick} onKeyDown={this.onMenuItemKeyDown.bind(this, item)}>
{item.text}
</DropdownItem>
);
}
</DropdownToggle>
<DropdownMenu>
{opList.map((item, index) => {
if (item == 'Divider') {
return <DropdownItem key={index} divider />;
} else {
return (
<DropdownItem key={index} onClick={item.onClick} onKeyDown={this.onMenuItemKeyDown.bind(this, item)}>
{item.text}
</DropdownItem>
);
}
})}
</DropdownMenu>
</Dropdown>
</Fragment>
})}
</DropdownMenu>
</Dropdown>
);
}
}