mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-10-03 12:10:34 +00:00
Only push scrolling down when Footer is present (#2807)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'gitbook': patch
|
||||
---
|
||||
|
||||
Don't add extra page scroll when footer is not present
|
||||
@@ -15,7 +15,15 @@ export default async function NotFound() {
|
||||
|
||||
return (
|
||||
<div
|
||||
className={tcls('flex-1', 'flex', 'flex-row', 'items-center', 'justify-center', 'py-9')}
|
||||
className={tcls(
|
||||
'flex-1',
|
||||
'flex',
|
||||
'flex-row',
|
||||
'items-center',
|
||||
'justify-center',
|
||||
'py-9',
|
||||
'min-h-[calc(100vh-64px)] lg:min-h-fit',
|
||||
)}
|
||||
>
|
||||
<div className={tcls('max-w-80')}>
|
||||
<h2 className={tcls('text-2xl', 'font-semibold', 'mb-2')}>
|
||||
|
||||
@@ -78,6 +78,12 @@ export async function SpaceLayout(props: {
|
||||
const visitorAuthToken = await getCurrentVisitorToken();
|
||||
const enabled = await shouldTrackEvents();
|
||||
|
||||
const withFooter =
|
||||
customization.themes.toggeable ||
|
||||
customization.footer.copyright ||
|
||||
customization.footer.logo ||
|
||||
customization.footer.groups?.length;
|
||||
|
||||
return (
|
||||
<InsightsProvider
|
||||
enabled={enabled}
|
||||
@@ -103,7 +109,7 @@ export async function SpaceLayout(props: {
|
||||
CONTAINER_STYLE,
|
||||
|
||||
// Ensure the footer is display below the viewport even if the content is not enough
|
||||
`min-h-[calc(100vh-64px)]`,
|
||||
withFooter && 'min-h-[calc(100vh-64px)]',
|
||||
withTopHeader ? null : 'lg:min-h-screen',
|
||||
)}
|
||||
>
|
||||
@@ -174,10 +180,7 @@ export async function SpaceLayout(props: {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{customization.themes.toggeable ||
|
||||
customization.footer.copyright ||
|
||||
customization.footer.logo ||
|
||||
customization.footer.groups?.length ? (
|
||||
{withFooter ? (
|
||||
<Footer space={space} context={contentRefContext} customization={customization} />
|
||||
) : null}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user