Web:Client:Settings: fix useless scroll for free user

This commit is contained in:
Timofey Boyko 2023-02-14 13:57:27 +03:00
parent de38d6da97
commit 7479a459f4
3 changed files with 25 additions and 4 deletions

View File

@ -30,6 +30,8 @@ const PersonalSettings = ({
showTitle,
createWithoutDialog,
setCreateWithoutDialog,
showAdminSettings,
}) => {
const [isLoadingFavorites, setIsLoadingFavorites] = React.useState(false);
const [isLoadingRecent, setIsLoadingRecent] = React.useState(false);
@ -75,7 +77,10 @@ const PersonalSettings = ({
};
return (
<StyledSettings showTitle={showTitle}>
<StyledSettings
showTitle={showTitle}
hideAdminSettings={!showAdminSettings}
>
<Box className="settings-section">
{showTitle && (
<Heading className="heading" level={2} size="xsmall">

View File

@ -3,10 +3,22 @@ import { tablet } from "@docspace/components/utils/device";
import { isMobile } from "react-device-detect";
const StyledSettings = styled.div`
margin-top: ${(props) => (props.showTitle ? 24 : 34)}px;
margin-top: ${(props) =>
props.hideAdminSettings ? 22 : props.showTitle ? 24 : 34}px;
${(props) =>
props.hideAdminSettings &&
css`
padding-top: 2px;
`}
@media ${tablet} {
margin-top: 8px;
margin-top: ${(props) => (props.hideAdminSettings ? 0 : 8)}px;
${(props) =>
props.hideAdminSettings &&
css`
padding-top: 8px;
`}
}
${isMobile &&

View File

@ -70,7 +70,11 @@ const SectionBodyContent = ({ isErrorSettings, history, user }) => {
) : (
<StyledContainer>
{!showAdminSettings ? (
<PersonalSettings t={t} showTitle={true} />
<PersonalSettings
t={t}
showTitle={true}
showAdminSettings={showAdminSettings}
/>
) : (
<Submenu
data={data}