1
0
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:
Michael An
2019-02-18 16:49:38 +08:00
committed by Daniel Pan
parent 8f383c938c
commit 24d39dfe64
7 changed files with 113 additions and 33 deletions

View File

@@ -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}