1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 15:53:28 +00:00

optimized code style

This commit is contained in:
shanshuirenjia
2018-12-11 13:44:09 +08:00
parent a25be1ce4c
commit 1a3bd048d8
4 changed files with 21 additions and 29 deletions

View File

@@ -14,8 +14,8 @@ class NewWikiDialog extends React.Component {
super(props);
this.state = {
isExist: false,
name: "",
repoID: "",
name: '',
repoID: '',
};
this.newName = React.createRef();
}
@@ -53,7 +53,7 @@ class NewWikiDialog extends React.Component {
<ModalHeader toggle={this.toggle}>{gettext('New Wiki')}</ModalHeader>
<ModalBody>
<label className="form-label">{gettext('Name')}</label>
<Input onKeyPress={this.handleKeyPress} innerRef={input => {this.newName = input}} value={this.state.name} onChange={this.inputNewName}/>
<Input onKeyPress={this.handleKeyPress} innerRef={input => {this.newName = input;}} value={this.state.name} onChange={this.inputNewName}/>
</ModalBody>
<ModalFooter>
<Button color="secondary" onClick={this.toggle}>{gettext('Cancel')}</Button>

View File

@@ -17,9 +17,9 @@ class WikiSelectDialog extends React.Component {
this.state = {
repos: [],
isExist: true,
name: "",
repoID: "",
}
name: '',
repoID: '',
};
}
componentDidMount() {
@@ -27,7 +27,7 @@ class WikiSelectDialog extends React.Component {
this.setState({
repos: res.data.repos,
});
})
});
}
onChange = (repo) => {
@@ -66,7 +66,7 @@ class WikiSelectDialog extends React.Component {
return (
<tr key={index}>
<td className="select"><input type="radio" className="vam" name="repo" value={repo.repo_id} onChange={this.onChange.bind(this, repo)} /></td>
<td><img src={siteRoot + 'media/img/lib/48/lib.png'} width="24" /></td>
<td><img src={siteRoot + 'media/img/lib/48/lib.png'} width="24" alt={gettext('icon')} /></td>
<td>{gettext(repo.repo_name)}</td>
<td>{moment(repo.last_modified).fromNow()}</td>
</tr>

View File

@@ -15,7 +15,7 @@ class WikiListView extends Component {
super(props);
this.state = {
isItemFreezed: false,
}
};
}
onFreezedItem = () => {
@@ -27,7 +27,7 @@ class WikiListView extends Component {
}
render() {
let {loading, errorMsg, wikis} = this.props.data;
let { loading, errorMsg, wikis } = this.props.data;
if (loading) {
return <span className="loading-icon loading-tip"></span>;