Skip to content

Commit

Permalink
only push scrolling down when Footer is present
Browse files Browse the repository at this point in the history
  • Loading branch information
scazan committed Feb 4, 2025
1 parent 2f73db7 commit e3c17d9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/gitbook/src/components/SpaceLayout/SpaceLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ 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}
Expand All @@ -103,7 +108,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',
)}
>
Expand Down Expand Up @@ -174,10 +179,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}

Expand Down

0 comments on commit e3c17d9

Please sign in to comment.