2020-03-25 10:03:04 +00:00
|
|
|
import React, { Fragment } from 'react';
|
2020-04-04 11:51:16 +00:00
|
|
|
import { gettext, siteRoot, enableTC, sideNavFooterCustomHtml, additionalAppBottomLinks } from '../utils/constants';
|
2019-02-11 08:18:35 +00:00
|
|
|
import ModalPortal from './modal-portal';
|
|
|
|
import AboutDialog from './dialog/about-dialog';
|
2018-09-30 04:19:30 +00:00
|
|
|
|
2019-02-11 08:18:35 +00:00
|
|
|
class SideNavFooter extends React.Component {
|
2018-10-16 10:19:51 +00:00
|
|
|
|
2018-09-30 04:19:30 +00:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
2019-02-11 08:18:35 +00:00
|
|
|
isAboutDialogShow: false,
|
2018-09-30 04:19:30 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-09-24 09:31:21 +00:00
|
|
|
onAboutDialogToggle = (e) => {
|
2021-09-29 07:23:02 +00:00
|
|
|
e.preventDefault();
|
2019-02-11 08:18:35 +00:00
|
|
|
this.setState({isAboutDialogShow: !this.state.isAboutDialogShow});
|
2023-09-13 00:40:50 +00:00
|
|
|
};
|
2018-10-16 10:19:51 +00:00
|
|
|
|
2020-03-25 10:03:04 +00:00
|
|
|
renderExternalAppLinks = () => {
|
2020-04-01 09:55:59 +00:00
|
|
|
if (additionalAppBottomLinks && (typeof additionalAppBottomLinks) === 'object') {
|
|
|
|
let keys = Object.keys(additionalAppBottomLinks);
|
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="item" href={additionalAppBottomLinks[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
|
|
|
|
2018-09-30 04:19:30 +00:00
|
|
|
render() {
|
2020-03-25 10:03:04 +00:00
|
|
|
|
|
|
|
if (sideNavFooterCustomHtml) {
|
|
|
|
return (<div className='side-nav-footer' dangerouslySetInnerHTML={{__html: sideNavFooterCustomHtml}}></div>);
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
<Fragment>
|
|
|
|
<div className="side-nav-footer flex-wrap">
|
2020-03-04 03:01:50 +00:00
|
|
|
<a href={siteRoot + 'help/'} target="_blank" rel="noopener noreferrer" className="item">{gettext('Help')}</a>
|
2021-09-24 09:31:21 +00:00
|
|
|
<a href="#" className="item" onClick={this.onAboutDialogToggle}>{gettext('About')}</a>
|
2020-04-04 11:51:16 +00:00
|
|
|
{enableTC && <a href={`${siteRoot}terms/`} className="item">{gettext('Terms')}</a>}
|
2020-03-25 10:03:04 +00:00
|
|
|
{this.renderExternalAppLinks()}
|
2020-04-01 09:55:59 +00:00
|
|
|
<a href={siteRoot + 'download_client_program/'} className={`item ${additionalAppBottomLinks ? '' : 'last-item'}`}>
|
2020-03-04 03:01:50 +00:00
|
|
|
<span aria-hidden="true" className="sf2-icon-monitor vam"></span>{' '}
|
|
|
|
<span className="vam">{gettext('Clients')}</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
2020-03-25 10:03:04 +00:00
|
|
|
{this.state.isAboutDialogShow && (
|
|
|
|
<ModalPortal>
|
|
|
|
<AboutDialog onCloseAboutDialog={this.onAboutDialogToggle} />
|
|
|
|
</ModalPortal>
|
|
|
|
)}
|
|
|
|
</Fragment>
|
|
|
|
);
|
2018-09-30 04:19:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SideNavFooter;
|