1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-18 17:22:05 +00:00
seahub/frontend/src/components/logo.js

39 lines
998 B
JavaScript
Raw Normal View History

2018-09-12 09:01:48 +00:00
import React from 'react';
2018-10-16 10:19:51 +00:00
import PropTypes from 'prop-types';
import { siteRoot, mediaUrl, logoPath, logoWidth, logoHeight, siteTitle } from '../utils/constants';
2018-09-12 09:01:48 +00:00
2018-10-16 10:19:51 +00:00
const propTypes = {
2019-04-25 02:50:06 +00:00
onCloseSidePanel: PropTypes.func,
showCloseSidePanelIcon: PropTypes.bool,
2018-09-12 09:01:48 +00:00
};
class Logo extends React.Component {
closeSide = () => {
this.props.onCloseSidePanel();
};
2018-09-12 09:01:48 +00:00
render() {
return (
<div className='top-logo'>
2018-10-16 10:19:51 +00:00
<a href={siteRoot} id="logo">
<img src={logoPath.indexOf('image-view') != -1 ? logoPath : mediaUrl + logoPath} height={logoHeight} width={logoWidth} title={siteTitle} alt="logo" />
2018-10-16 10:19:51 +00:00
</a>
2019-04-25 02:50:06 +00:00
{this.props.showCloseSidePanelIcon &&
<a
2019-04-25 02:50:06 +00:00
className="sf2-icon-x1 sf-popover-close side-panel-close action-icon d-md-none"
onClick={this.closeSide}
title="Close"
aria-label="Close"
2019-04-25 02:50:06 +00:00
>
</a>
}
2018-10-16 10:19:51 +00:00
</div>
2018-09-12 09:01:48 +00:00
);
}
}
2018-10-16 10:19:51 +00:00
Logo.propTypes = propTypes;
2018-09-12 09:01:48 +00:00
export default Logo;