Scroll behavior part 2 (#1304)
* Fix layout issues introduced by scroll behavior * Complete scrollbar work
This commit is contained in:
@ -2,27 +2,33 @@ import { ReactElement } from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
|
||||
import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
|
||||
|
||||
const StyledShowPageLeftContainer = styled.div`
|
||||
const StyledOuterContainer = styled.div`
|
||||
background: ${({ theme }) => theme.background.secondary};
|
||||
border-bottom-left-radius: 8px;
|
||||
border-right: 1px solid
|
||||
${({ theme }) => {
|
||||
const isMobile = useIsMobile();
|
||||
return !isMobile ? theme.border.color.medium : 0;
|
||||
}};
|
||||
border-right: ${({ theme }) => {
|
||||
const isMobile = useIsMobile();
|
||||
return !isMobile ? `1px solid ${theme.border.color.medium}` : 'none';
|
||||
}};
|
||||
border-top-left-radius: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: ${({ theme }) => theme.spacing(3)};
|
||||
padding: 0px ${({ theme }) => theme.spacing(3)};
|
||||
|
||||
z-index: 10;
|
||||
`;
|
||||
|
||||
const StyledInnerContainer = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0px ${({ theme }) => theme.spacing(2)} 0px
|
||||
${({ theme }) => theme.spacing(3)};
|
||||
width: ${({ theme }) => {
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
return isMobile ? `calc(100% - ${theme.spacing(6)})` : '320px';
|
||||
return isMobile ? `calc(100% - ${theme.spacing(5)})` : '320px';
|
||||
}};
|
||||
|
||||
z-index: 10;
|
||||
`;
|
||||
|
||||
export type ShowPageLeftContainerProps = {
|
||||
@ -32,5 +38,16 @@ export type ShowPageLeftContainerProps = {
|
||||
export function ShowPageLeftContainer({
|
||||
children,
|
||||
}: ShowPageLeftContainerProps) {
|
||||
return <StyledShowPageLeftContainer>{children} </StyledShowPageLeftContainer>;
|
||||
const isMobile = useIsMobile();
|
||||
return isMobile ? (
|
||||
<StyledOuterContainer>
|
||||
<StyledInnerContainer>{children}</StyledInnerContainer>
|
||||
</StyledOuterContainer>
|
||||
) : (
|
||||
<StyledOuterContainer>
|
||||
<ScrollWrapper>
|
||||
<StyledInnerContainer>{children}</StyledInnerContainer>
|
||||
</ScrollWrapper>
|
||||
</StyledOuterContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@ -9,11 +9,7 @@ export const StyledShowPageRightContainer = styled.div`
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
overflow: ${() => (useIsMobile() ? 'none' : 'hidden')};
|
||||
width: ${({ theme }) => {
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
return isMobile ? `calc(100% - ${theme.spacing(6)})` : 'auto';
|
||||
}};
|
||||
width: calc(100% + 4px);
|
||||
`;
|
||||
|
||||
export type ShowPageRightContainerProps = {
|
||||
|
||||
Reference in New Issue
Block a user