[web] Allow OVERLEAF_NAV_TITLE and OVERLEAF_HEADER_IMAGE_URL to be used at the same time (#28445)
* Remove unused navbar-website-redesign.pug * Add custom logo and title to the navbar settings * Update navbar-header so it handles logo+title, and without overflowing * Revert "Add custom logo and title to the navbar settings" This reverts commit a860fca916714fa34befa231a0b7f43fcbcc3aee. GitOrigin-RevId: 4d87b47a5c6f64130fe2b57c57ee8f808baef271
This commit is contained in:
@@ -9,33 +9,20 @@ export default function HeaderLogoOrTitle({
|
||||
overleafLogo?: string
|
||||
}) {
|
||||
const { appName } = getMeta('ol-ExposedSettings')
|
||||
if (customLogo) {
|
||||
return (
|
||||
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
||||
<a
|
||||
href="/"
|
||||
aria-label={appName}
|
||||
className="navbar-brand"
|
||||
style={{ backgroundImage: `url("${customLogo}")` }}
|
||||
/>
|
||||
)
|
||||
} else if (title) {
|
||||
return (
|
||||
<a href="/" aria-label={appName} className="navbar-title">
|
||||
{title}
|
||||
</a>
|
||||
)
|
||||
} else {
|
||||
const style = overleafLogo
|
||||
? {
|
||||
style: {
|
||||
backgroundImage: `url("${overleafLogo}")`,
|
||||
},
|
||||
}
|
||||
: null
|
||||
return (
|
||||
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
||||
<a href="/" aria-label={appName} className="navbar-brand" {...style} />
|
||||
)
|
||||
}
|
||||
const logoUrl = customLogo ?? overleafLogo
|
||||
return (
|
||||
<a href="/" aria-label={appName} className="navbar-brand">
|
||||
{(customLogo || !title) && (
|
||||
<div
|
||||
className="navbar-logo"
|
||||
style={logoUrl ? { backgroundImage: `url("${logoUrl}")` } : {}}
|
||||
/>
|
||||
)}
|
||||
{title && (
|
||||
<div className="navbar-title">
|
||||
<span>{title}</span>
|
||||
</div>
|
||||
)}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user