2019-02-11 08:18:35 +00:00
|
|
|
|
import React from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
import { Modal, ModalBody } from 'reactstrap';
|
2020-03-25 10:03:04 +00:00
|
|
|
|
import { gettext, lang, mediaUrl, logoPath, logoWidth, logoHeight, siteTitle, seafileVersion, extraAboutDialogLinks } from '../../utils/constants';
|
2019-02-11 08:18:35 +00:00
|
|
|
|
|
|
|
|
|
const propTypes = {
|
|
|
|
|
onCloseAboutDialog: PropTypes.func.isRequired,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class AboutDialog extends React.Component {
|
|
|
|
|
|
|
|
|
|
toggle = () => {
|
|
|
|
|
this.props.onCloseAboutDialog();
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-25 10:03:04 +00:00
|
|
|
|
renderExternalAboutLinks = () => {
|
|
|
|
|
if (extraAboutDialogLinks && (typeof extraAboutDialogLinks) === 'object') {
|
|
|
|
|
let keys = Object.keys(extraAboutDialogLinks);
|
|
|
|
|
return keys.map((key, index) => {
|
2020-03-25 12:20:56 +00:00
|
|
|
|
return <a key={index} className="d-block" href={extraAboutDialogLinks[key]}>{key}</a>;
|
2020-03-25 10:03:04 +00:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-11 08:18:35 +00:00
|
|
|
|
render() {
|
|
|
|
|
let href = lang === lang == 'zh-cn' ? 'http://seafile.com/about/' : 'http://seafile.com/en/about/';
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Modal isOpen={true} toggle={this.toggle}>
|
|
|
|
|
<ModalBody>
|
|
|
|
|
<button type="button" className="close" onClick={this.toggle}><span aria-hidden="true">×</span></button>
|
|
|
|
|
<div className="about-content">
|
|
|
|
|
<p><img src={mediaUrl + logoPath} height={logoHeight} width={logoWidth} title={siteTitle} alt="logo" /></p>
|
|
|
|
|
<p>{gettext('Server Version: ')}{seafileVersion}<br />© 2019 {gettext('Seafile')}</p>
|
2020-03-25 10:03:04 +00:00
|
|
|
|
<p>{this.renderExternalAboutLinks()}</p>
|
2019-02-11 08:18:35 +00:00
|
|
|
|
<p><a href={href} target="_blank">{gettext('About Us')}</a></p>
|
|
|
|
|
</div>
|
|
|
|
|
</ModalBody>
|
|
|
|
|
</Modal>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AboutDialog.propTypes = propTypes;
|
|
|
|
|
|
|
|
|
|
export default AboutDialog;
|