1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

['settings' page] fixup for the display of the logo (#6323)

This commit is contained in:
llj
2024-07-10 11:24:43 +08:00
committed by GitHub
parent a378b243e6
commit a0ad4ee4e7
2 changed files with 13 additions and 4 deletions

View File

@@ -1,11 +1,13 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { siteRoot, mediaUrl, logoPath, logoWidth, logoHeight, siteTitle } from '../utils/constants'; import { siteRoot, mediaUrl, logoPath, logoWidth, logoHeight, siteTitle } from '../utils/constants';
import { Utils } from '../utils/utils';
const propTypes = { const propTypes = {
onCloseSidePanel: PropTypes.func, onCloseSidePanel: PropTypes.func,
showCloseSidePanelIcon: PropTypes.bool, showCloseSidePanelIcon: PropTypes.bool,
positioned: PropTypes.bool positioned: PropTypes.bool,
showLogoOnlyInMobile: PropTypes.bool
}; };
class Logo extends React.Component { class Logo extends React.Component {
@@ -15,7 +17,12 @@ class Logo extends React.Component {
}; };
render() { render() {
const { positioned } = this.props; const { positioned, showLogoOnlyInMobile } = this.props;
if (showLogoOnlyInMobile && Utils.isDesktop()) {
return null;
}
return ( return (
<div className={`top-logo ${positioned ? 'd-none d-md-block positioned-top-logo' : ''}`}> <div className={`top-logo ${positioned ? 'd-none d-md-block positioned-top-logo' : ''}`}>
<a href={siteRoot} id="logo"> <a href={siteRoot} id="logo">

View File

@@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classnames from 'classnames'; import classnames from 'classnames';
import { Utils } from '../utils/utils';
import Logo from './logo'; import Logo from './logo';
import MainSideNav from './main-side-nav'; import MainSideNav from './main-side-nav';
import { SIDE_PANEL_FOLDED_WIDTH } from '../constants'; import { SIDE_PANEL_FOLDED_WIDTH } from '../constants';
@@ -25,7 +24,10 @@ class SidePanel extends React.Component {
return ( return (
<div className={classnames('side-panel', { 'side-panel-folded': isSidePanelFolded, 'left-zero': !this.props.isSidePanelClosed })} style={style}> <div className={classnames('side-panel', { 'side-panel-folded': isSidePanelFolded, 'left-zero': !this.props.isSidePanelClosed })} style={style}>
<div className={'side-panel-north'}> <div className={'side-panel-north'}>
{showLogoOnlyInMobile && !Utils.isDesktop() && <Logo onCloseSidePanel={this.props.onCloseSidePanel} />} <Logo
onCloseSidePanel={this.props.onCloseSidePanel}
showLogoOnlyInMobile={showLogoOnlyInMobile}
/>
</div> </div>
<div className="side-panel-center"> <div className="side-panel-center">
{children ? children : ( {children ? children : (