Prevent layout shift on page load (#2268)

- prevent layout shift on page load
This commit is contained in:
brendanlaschke 2023-10-31 14:09:33 +01:00 committed by GitHub
parent dda911fea7
commit 48aa89664a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -50,6 +50,7 @@ const NavCollapseButton = ({
return (
<>
<StyledCollapseButton
initial={{ opacity: show ? 1 : 0 }}
animate={{
opacity: show ? 1 : 0,
}}

View File

@ -48,6 +48,7 @@ export const NavbarAnimatedContainer = ({
onAnimationComplete={() => {
setIsNavbarSwitchingSize(false);
}}
initial={{ width: isNavbarOpened ? leftBarWidth : '0' }}
animate={{
width: isNavbarOpened ? leftBarWidth : '0',
opacity: isNavbarOpened ? 1 : 0,