mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 00:20:07 +00:00
Change select group UI (#7201)
* 01 share repo to group UI * 02 ADD_SHARED_REPO_INTO_GROUP * 03 share folder to groups * 04 system admin share repo to group * 05 remove old NoGroupMessage * 06 change API * change API * change select icons indents
This commit is contained in:
@@ -3,13 +3,27 @@ import PropTypes from 'prop-types';
|
||||
import Select, { components } from 'react-select';
|
||||
import { MenuSelectStyle } from './seahub-select-style';
|
||||
|
||||
const DropdownIndicator = props => {
|
||||
return (
|
||||
components.DropdownIndicator && (
|
||||
<components.DropdownIndicator {...props}>
|
||||
<span className="sf3-font sf3-font-down" style={{ fontSize: '12px', marginLeft: '-2px' }} aria-hidden="true"></span>
|
||||
</components.DropdownIndicator>
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const ClearIndicator = ({ innerProps, ...props }) => {
|
||||
const onMouseDown = e => {
|
||||
e.nativeEvent.stopImmediatePropagation();
|
||||
innerProps.onMouseDown(e);
|
||||
};
|
||||
props.innerProps = { ...innerProps, onMouseDown };
|
||||
return <components.ClearIndicator {...props} />;
|
||||
return (
|
||||
<components.ClearIndicator {...props} >
|
||||
<span className="sf3-font sf3-font-x-01" style={{ fontSize: '12px', marginLeft: '-2px' }} aria-hidden="true"></span>
|
||||
</components.ClearIndicator>
|
||||
);
|
||||
};
|
||||
|
||||
ClearIndicator.propTypes = {
|
||||
@@ -93,7 +107,7 @@ export default class SeahubSelect extends React.Component {
|
||||
className={className}
|
||||
classNamePrefix={classNamePrefix}
|
||||
styles={MenuSelectStyle}
|
||||
components={{ Option, MenuList, ClearIndicator }}
|
||||
components={{ Option, DropdownIndicator, MenuList, ClearIndicator }}
|
||||
placeholder={placeholder}
|
||||
isSearchable={isSearchable}
|
||||
isClearable={isClearable}
|
||||
|
Reference in New Issue
Block a user