fix: spacing of footer and affix

This commit is contained in:
iCrawl
2022-08-23 09:15:33 +02:00
parent c826ad3ade
commit 28422eea58
3 changed files with 18 additions and 16 deletions

View File

@@ -226,19 +226,6 @@ export default function SlugPage(props: Partial<SidebarLayoutProps & { error?: s
<title key="title">{name}</title>
</Head>
{member(props.data.member)}
<Affix position={{ bottom: 20, right: matches ? 20 : 280 }}>
<Transition transition="slide-up" mounted={scroll.y > 250}>
{(transitionStyles) => (
<Button
leftIcon={<VscChevronUp size={20} />}
style={transitionStyles}
onClick={() => scrollTo({ y: 0 })}
>
Scroll to top
</Button>
)}
</Transition>
</Affix>
</>
) : props.data?.source ? (
<Box
@@ -259,6 +246,21 @@ export default function SlugPage(props: Partial<SidebarLayoutProps & { error?: s
<MDXRemote {...props.data.source} />
</Box>
) : null}
<Affix
position={{
bottom: 20,
right:
matches || (props.data?.member?.kind !== 'Class' && props.data?.member?.kind !== 'Interface') ? 20 : 280,
}}
>
<Transition transition="slide-up" mounted={scroll.y > 200}>
{(transitionStyles) => (
<Button leftIcon={<VscChevronUp size={20} />} style={transitionStyles} onClick={() => scrollTo({ y: 0 })}>
Scroll to top
</Button>
)}
</Transition>
</Affix>
</SidebarLayout>
</MemberProvider>
);