1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-23 11:22:37 +00:00
seahub/frontend/src/components/side-nav-footer.js

71 lines
2.0 KiB
JavaScript
Raw Normal View History

import React from 'react';
2018-10-16 10:19:51 +00:00
import PropTypes from 'prop-types';
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-10-16 10:19:51 +00:00
const propTypes = {
className: PropTypes.string,
};
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;
}
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}>
<ModalBody>
2019-01-05 08:20:21 +00:00
<button type="button" className="close" onClick={this.toggle}><span aria-hidden="true">×</span></button>
<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>
</div>
</ModalBody>
</Modal>
</div>
);
}
}
2018-10-16 10:19:51 +00:00
About.propTypes = propTypes;
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>
<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;