Fix navbar animation layout shift (#2335)

fix navbar animation
This commit is contained in:
brendanlaschke
2023-11-03 11:04:30 +01:00
committed by GitHub
parent f19ed5e2e4
commit e3691ad143
3 changed files with 3 additions and 8 deletions

View File

@ -39,16 +39,11 @@ const StyledLayout = styled.div`
}
`;
const NAVBAR_WIDTH = '236px';
const StyledMainContainer = styled.div`
display: flex;
flex: 1;
flex-direction: row;
overflow: hidden;
width: ${() =>
useRecoilValue(isNavbarOpenedState)
? `calc(100% - ${NAVBAR_WIDTH})`
: '100%'};
@media (max-width: ${MOBILE_VIEWPORT}px) {
width: ${() => (useRecoilValue(isNavbarOpenedState) ? '0' : '100%')};
}