mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
user-select-translation (#2956)
This commit is contained in:
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import AsyncSelect from 'react-select/lib/Async';
|
||||
import { seafileAPI } from '../utils/seafile-api.js';
|
||||
import gettext from '../utils/constants';
|
||||
|
||||
const propTypes = {
|
||||
placeholder: PropTypes.string.isRequired,
|
||||
@@ -10,6 +11,12 @@ const propTypes = {
|
||||
className: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
const NoOptionsMessage = (props) => {
|
||||
return (
|
||||
<div {...props.innerProps} style={{margin: '6px 10px', textAlign: 'center', color: 'hsl(0,0%,50%)'}}>{gettext('No Options.')}</div>
|
||||
);
|
||||
};
|
||||
|
||||
class UserSelect extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
@@ -53,6 +60,7 @@ class UserSelect extends React.Component {
|
||||
<AsyncSelect
|
||||
isClearable
|
||||
classNamePrefix
|
||||
components={{ NoOptionsMessage }}
|
||||
isMulti={this.props.isMulti}
|
||||
loadOptions={this.loadOptions}
|
||||
onChange={this.handleSelectChange}
|
||||
|
Reference in New Issue
Block a user