Web: Common: Fixed scrolling of article on small tablet and mobile, fixed margin top of unpin article.

This commit is contained in:
TatianaLopaeva 2021-01-22 16:50:20 +03:00
parent 711fc4954e
commit 545dacc8ca
2 changed files with 11 additions and 4 deletions

View File

@ -18,7 +18,7 @@ import store from "../../store";
const { setIsTabletView } = store.auth.actions;
const { getIsTabletView, isArticlePinned } = store.auth.selectors;
const { size } = utils.device;
const { size, isSmallTablet } = utils.device;
const StyledContainer = styled.div`
width: 100%;
@ -49,14 +49,21 @@ const StyledContainer = styled.div`
#articleScrollBar {
> .scroll-body {
position: ${isMobile ? "static" : "absolute"} !important;
position: ${(props) =>
isMobile && !isSmallTablet()
? props.isArticlePinned
? "static"
: "absolute"
: "absolute"} !important;
${(props) =>
isMobile &&
props.isArticlePinned &&
!isSmallTablet() &&
css`
overflow-y: hidden !important;
overflow-x: hidden !important;
width: 208px;
/* max-width: calc(100vw - 576px);
min-width: 208px; */
`}/* > div:first-child {
@ -80,7 +87,7 @@ const StyledContainer = styled.div`
`;
const Layout = (props) => {
const { children, isTabletView, setIsTabletView } = props;
const { children, isTabletView, setIsTabletView, isArticlePinned } = props;
const [contentHeight, setContentHeight] = useState();
const [isPortrait, setIsPortrait] = useState();

View File

@ -34,7 +34,7 @@ const StyledArticle = styled.article`
}
${isMobile &&
css`
margin-top: 56px;
margin-top: ${(props) => (props.pinned ? "56px;" : "0;")}
height: calc(100% - 56px) !important;
width: 240px !important;
`}