mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
Code optimized (#2388)
This commit is contained in:
committed by
Daniel Pan
parent
6b62d3e653
commit
490a15deed
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
|
||||
import { Modal, ModalHeader, ModalBody } from 'reactstrap';
|
||||
import { gettext, siteRoot } from './constants';
|
||||
import { Modal, ModalBody } from 'reactstrap';
|
||||
|
||||
class About extends React.Component {
|
||||
constructor(props) {
|
||||
@@ -8,11 +8,9 @@ class About extends React.Component {
|
||||
this.state = {
|
||||
modal: false
|
||||
};
|
||||
|
||||
this.toggle = this.toggle.bind(this);
|
||||
}
|
||||
|
||||
toggle() {
|
||||
toggle = () => {
|
||||
this.setState({
|
||||
modal: !this.state.modal
|
||||
});
|
||||
@@ -21,14 +19,14 @@ class About extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<a href="#" className="item" onClick={this.toggle}>About</a>
|
||||
<a href="#" className="item" onClick={this.toggle}>{gettext('About')}</a>
|
||||
<Modal isOpen={this.state.modal} toggle={this.toggle} className={this.props.className}>
|
||||
<ModalBody>
|
||||
<div className="about-content">
|
||||
<p><img src="/media/img/seafile-logo.png" title="Private Seafile" alt="logo" width="128" height="32" /></p>
|
||||
<p>Server Version: 6.3.3<br /> © 2018 Seafile</p>
|
||||
<p><a href="http://seafile.com/about/" target="_blank">About Us</a></p>
|
||||
</div>
|
||||
<div className="about-content">
|
||||
<p><img src="/media/img/seafile-logo.png" title="Private Seafile" alt="logo" width="128" height="32" /></p>
|
||||
<p>{gettext('Server Version: 6.3.3')}<br />{gettext('© 2018 Seafile')}</p>
|
||||
<p><a href="http://seafile.com/about/" target="_blank">{gettext('About Us')}</a></p>
|
||||
</div>
|
||||
</ModalBody>
|
||||
</Modal>
|
||||
</div>
|
||||
@@ -40,11 +38,11 @@ class SideNavFooter extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="side-nav-footer">
|
||||
<a href="/help/" target="_blank" className="item">Help</a>
|
||||
<a href={siteRoot + 'help/'} target="_blank" className="item">{gettext('Help')}</a>
|
||||
<About />
|
||||
<a href="/download_client_program/" className="item last-item">
|
||||
<a href={siteRoot + 'download_client_program/'} className="item last-item">
|
||||
<span aria-hidden="true" className="sf2-icon-monitor vam"></span>{' '}
|
||||
<span className="vam">Clients</span>
|
||||
<span className="vam">{gettext('Clients')}</span>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
|
Reference in New Issue
Block a user