2019-02-11 08:18:35 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Modal, ModalBody } from 'reactstrap';
|
2020-12-02 13:31:17 +00:00
|
|
|
import { gettext, lang, mediaUrl, logoPath, logoWidth, logoHeight, siteTitle, seafileVersion, additionalAboutDialogLinks, aboutDialogCustomHtml } from '../../utils/constants';
|
2025-01-17 08:00:32 +00:00
|
|
|
import '../../css/seahub-modal-header.css';
|
2019-02-11 08:18:35 +00:00
|
|
|
|
|
|
|
const propTypes = {
|
|
|
|
onCloseAboutDialog: PropTypes.func.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
class AboutDialog extends React.Component {
|
|
|
|
|
2020-03-25 10:03:04 +00:00
|
|
|
renderExternalAboutLinks = () => {
|
2020-04-01 09:55:59 +00:00
|
|
|
if (additionalAboutDialogLinks && (typeof additionalAboutDialogLinks) === 'object') {
|
|
|
|
let keys = Object.keys(additionalAboutDialogLinks);
|
2020-03-25 10:03:04 +00:00
|
|
|
return keys.map((key, index) => {
|
2020-04-01 09:55:59 +00:00
|
|
|
return <a key={index} className="d-block" href={additionalAboutDialogLinks[key]}>{key}</a>;
|
2020-03-25 10:03:04 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
return null;
|
2023-09-13 00:40:50 +00:00
|
|
|
};
|
2020-03-25 10:03:04 +00:00
|
|
|
|
2019-02-11 08:18:35 +00:00
|
|
|
render() {
|
2023-09-13 00:40:50 +00:00
|
|
|
let href = lang === 'zh-cn' ? 'http://seafile.com/about/' : 'http://seafile.com/en/about/';
|
2021-09-29 07:23:02 +00:00
|
|
|
const { onCloseAboutDialog: toggleDialog } = this.props;
|
2019-02-11 08:18:35 +00:00
|
|
|
|
2020-12-02 13:31:17 +00:00
|
|
|
if (aboutDialogCustomHtml) {
|
|
|
|
return (
|
2021-09-29 07:23:02 +00:00
|
|
|
<Modal isOpen={true} toggle={toggleDialog}>
|
2020-12-02 13:31:17 +00:00
|
|
|
<ModalBody>
|
2025-01-17 08:00:32 +00:00
|
|
|
<button type="button" className="close seahub-modal-btn p-0" aria-label={gettext('Close')} onClick={toggleDialog}>
|
|
|
|
<span className="seahub-modal-btn-inner">
|
|
|
|
<i className="sf3-font sf3-font-x-01" aria-hidden="true"></i>
|
|
|
|
</span>
|
|
|
|
</button>
|
2024-07-19 03:14:28 +00:00
|
|
|
<div className="about-content" dangerouslySetInnerHTML={{ __html: aboutDialogCustomHtml }}></div>
|
2020-12-02 13:31:17 +00:00
|
|
|
</ModalBody>
|
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return (
|
2021-09-29 07:23:02 +00:00
|
|
|
<Modal isOpen={true} toggle={toggleDialog}>
|
2020-12-02 13:31:17 +00:00
|
|
|
<ModalBody>
|
2025-01-17 08:00:32 +00:00
|
|
|
<button type="button" className="close seahub-modal-btn p-0" aria-label={gettext('Close')} onClick={toggleDialog}>
|
|
|
|
<span className="seahub-modal-btn-inner">
|
|
|
|
<i className="sf3-font sf3-font-x-01" aria-hidden="true"></i>
|
|
|
|
</span>
|
|
|
|
</button>
|
2020-12-02 13:31:17 +00:00
|
|
|
<div className="about-content">
|
|
|
|
<p><img src={mediaUrl + logoPath} height={logoHeight} width={logoWidth} title={siteTitle} alt="logo" /></p>
|
2021-01-09 10:24:07 +00:00
|
|
|
<p>{gettext('Server Version: ')}{seafileVersion}<br />© {(new Date()).getFullYear()} {gettext('Seafile')}</p>
|
2020-12-02 13:31:17 +00:00
|
|
|
<p>{this.renderExternalAboutLinks()}</p>
|
2023-09-13 00:40:50 +00:00
|
|
|
<p><a href={href} target="_blank" rel="noreferrer">{gettext('About Us')}</a></p>
|
2020-12-02 13:31:17 +00:00
|
|
|
</div>
|
|
|
|
</ModalBody>
|
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|
2019-02-11 08:18:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AboutDialog.propTypes = propTypes;
|
|
|
|
|
|
|
|
export default AboutDialog;
|