Skip to content

Commit

Permalink
['settings' page] fixup for the display of the logo
Browse files Browse the repository at this point in the history
  • Loading branch information
llj committed Jul 10, 2024
1 parent a378b24 commit 1382c50
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 9 additions & 2 deletions frontend/src/components/logo.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types';
import { siteRoot, mediaUrl, logoPath, logoWidth, logoHeight, siteTitle } from '../utils/constants';
import { Utils } from '../utils/utils';

const propTypes = {
onCloseSidePanel: PropTypes.func,
showCloseSidePanelIcon: PropTypes.bool,
positioned: PropTypes.bool
positioned: PropTypes.bool,
showLogoOnlyInMobile: PropTypes.bool
};

class Logo extends React.Component {
Expand All @@ -15,7 +17,12 @@ class Logo extends React.Component {
};

render() {
const { positioned } = this.props;
const { positioned, showLogoOnlyInMobile } = this.props;

if (showLogoOnlyInMobile && Utils.isDesktop()) {
return null;
}

return (
<div className={`top-logo ${positioned ? 'd-none d-md-block positioned-top-logo' : ''}`}>
<a href={siteRoot} id="logo">
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/side-panel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { Utils } from '../utils/utils';
import Logo from './logo';
import MainSideNav from './main-side-nav';
import { SIDE_PANEL_FOLDED_WIDTH } from '../constants';
Expand All @@ -25,7 +24,10 @@ class SidePanel extends React.Component {
return (
<div className={classnames('side-panel', { 'side-panel-folded': isSidePanelFolded, 'left-zero': !this.props.isSidePanelClosed })} style={style}>
<div className={'side-panel-north'}>
{showLogoOnlyInMobile && !Utils.isDesktop() && <Logo onCloseSidePanel={this.props.onCloseSidePanel} />}
<Logo
onCloseSidePanel={this.props.onCloseSidePanel}
showLogoOnlyInMobile={showLogoOnlyInMobile}
/>
</div>
<div className="side-panel-center">
{children ? children : (
Expand Down

0 comments on commit 1382c50

Please sign in to comment.