2018-09-30 04:19:30 +00:00
|
|
|
|
import React from 'react';
|
2018-10-16 10:19:51 +00:00
|
|
|
|
import PropTypes from 'prop-types';
|
2018-09-30 04:19:30 +00:00
|
|
|
|
import { Modal, ModalBody } from 'reactstrap';
|
2019-01-07 08:28:25 +00:00
|
|
|
|
import { gettext, lang, siteRoot, mediaUrl, logoPath, logoWidth, logoHeight, siteTitle, seafileVersion } from '../utils/constants';
|
2018-09-30 04:19:30 +00:00
|
|
|
|
|
2018-10-16 10:19:51 +00:00
|
|
|
|
const propTypes = {
|
|
|
|
|
className: PropTypes.string,
|
|
|
|
|
};
|
|
|
|
|
|
2018-09-30 04:19:30 +00:00
|
|
|
|
class About extends React.Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
|
|
|
|
modal: false
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
toggle = () => {
|
|
|
|
|
this.setState({
|
|
|
|
|
modal: !this.state.modal
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-07 08:28:25 +00:00
|
|
|
|
aboutUrl = () => {
|
|
|
|
|
let url;
|
|
|
|
|
if (lang == 'zh-cn') {
|
|
|
|
|
url = 'http://seafile.com/about/';
|
|
|
|
|
return url;
|
|
|
|
|
}
|
|
|
|
|
url = 'http://seafile.com/en/about/';
|
|
|
|
|
return url;
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-30 04:19:30 +00:00
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<a href="#" className="item" onClick={this.toggle}>{gettext('About')}</a>
|
2019-01-11 10:00:07 +00:00
|
|
|
|
<Modal isOpen={this.state.modal} toggle={this.toggle} className={this.props.className}>
|
2018-09-30 04:19:30 +00:00
|
|
|
|
<ModalBody>
|
2019-01-05 08:20:21 +00:00
|
|
|
|
<button type="button" className="close" onClick={this.toggle}><span aria-hidden="true">×</span></button>
|
2018-09-30 04:19:30 +00:00
|
|
|
|
<div className="about-content">
|
2019-01-07 08:28:25 +00:00
|
|
|
|
<p><img src={mediaUrl + logoPath} height={logoHeight} width={logoWidth} title={siteTitle} alt="logo" /></p>
|
|
|
|
|
<p>{gettext('Server Version: ')}{seafileVersion}<br />© 2019 {gettext('Seafile')}</p>
|
|
|
|
|
<p><a href={this.aboutUrl()} target="_blank">{gettext('About Us')}</a></p>
|
2018-09-30 04:19:30 +00:00
|
|
|
|
</div>
|
|
|
|
|
</ModalBody>
|
|
|
|
|
</Modal>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-16 10:19:51 +00:00
|
|
|
|
About.propTypes = propTypes;
|
|
|
|
|
|
2018-09-30 04:19:30 +00:00
|
|
|
|
class SideNavFooter extends React.Component {
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div className="side-nav-footer">
|
2018-10-16 10:19:51 +00:00
|
|
|
|
<a href={siteRoot + 'help/'} target="_blank" rel="noopener noreferrer" className="item">{gettext('Help')}</a>
|
2018-09-30 04:19:30 +00:00
|
|
|
|
<About />
|
|
|
|
|
<a href={siteRoot + 'download_client_program/'} className="item last-item">
|
|
|
|
|
<span aria-hidden="true" className="sf2-icon-monitor vam"></span>{' '}
|
|
|
|
|
<span className="vam">{gettext('Clients')}</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default SideNavFooter;
|