1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

fix language select style (#5693)

* fix language select style

* fix this.tabItemClick bug
This commit is contained in:
Michael An
2023-10-19 13:43:26 +08:00
committed by GitHub
parent 60bb02f3ac
commit 42eacdb388
3 changed files with 5 additions and 27 deletions

View File

@@ -50,6 +50,7 @@ export default class SeahubSelect extends React.Component {
isClearable: PropTypes.bool,
placeholder: PropTypes.string,
classNamePrefix: PropTypes.string,
className: PropTypes.string,
form: PropTypes.string,
onChange: PropTypes.func.isRequired,
menuPortalTarget: PropTypes.string,
@@ -79,7 +80,8 @@ export default class SeahubSelect extends React.Component {
render() {
const { options, onChange, value, isSearchable, placeholder, isMulti, menuPosition, isClearable, noOptionsMessage,
classNamePrefix, innerRef, isDisabled, form } = this.props;
classNamePrefix, innerRef, isDisabled, form, className } = this.props;
return (
<Select
value={value}
@@ -88,6 +90,7 @@ export default class SeahubSelect extends React.Component {
onChange={onChange}
options={options}
isMulti={isMulti}
className={className}
classNamePrefix={classNamePrefix}
styles={MenuSelectStyle}
components={{ Option, MenuList, ClearIndicator }}

View File

@@ -28,16 +28,9 @@ class DirentDetail extends React.Component {
direntType: '',
direntDetail: '',
folderDirent: null,
fileParticipantList: [],
};
}
componentWillMount() {
if (this.props.direntDetailPanelTab) {
this.tabItemClick(this.props.direntDetailPanelTab);
}
}
componentDidMount() {
let { dirent, path, repoID } = this.props;
this.loadDirentInfo(dirent, path, repoID);
@@ -48,9 +41,6 @@ class DirentDetail extends React.Component {
if (this.props.dirent !== nextProps.dirent) {
this.loadDirentInfo(dirent, path, repoID);
}
if (this.props.direntDetailPanelTab) {
this.tabItemClick(this.props.direntDetailPanelTab);
}
}
loadDirentInfo = (dirent, path, repoID) => {
@@ -90,7 +80,6 @@ class DirentDetail extends React.Component {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
this.listParticipants(repoID, direntPath);
} else {
seafileAPI.getDirInfo(repoID, direntPath).then(res => {
this.setState({
@@ -104,16 +93,6 @@ class DirentDetail extends React.Component {
}
};
listParticipants = (repoID, filePath) => {
seafileAPI.listFileParticipants(repoID, filePath).then((res) => {
this.setState({ fileParticipantList: res.data.participant_list });
});
};
onParticipantsChange = (repoID, filePath) => {
this.listParticipants(repoID, filePath);
};
renderHeader = (smallIconUrl, direntName) => {
return (
<div className="detail-header">

View File

@@ -8,10 +8,6 @@ const {
class LanguageSetting extends React.Component {
constructor(props) {
super(props);
}
onSelectChange = (selectedItem) => {
// selectedItem: {value: '...', label: '...'}
location.href = `${siteRoot}i18n/?lang=${selectedItem.value}`;
@@ -30,7 +26,7 @@ class LanguageSetting extends React.Component {
<h3 className="setting-item-heading">{gettext('Language Setting')}</h3>
<SeahubSelect
className='language-selector'
defaultValue={{value: currentLang.langCode, label: currentLang.langName}}
value={{value: currentLang.langCode, label: currentLang.langName}}
options={options}
onChange={this.onSelectChange}
/>