Skip to content

Commit

Permalink
Web: Common: PageLayout: Refactoring, deleted useless code.
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/asc-web-common/components/PageLayout/sub-components/section-body.js
  • Loading branch information
TatianaLopaeva committed Nov 3, 2021
1 parent e2c435d commit 6cf7c6d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 31 deletions.
2 changes: 0 additions & 2 deletions packages/asc-web-common/components/PageLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ class PageLayout extends React.Component {
isBackdropVisible,
isArticlePinned,
isDesktop,
isLoadingContent,
} = this.props;
let articleHeaderContent = null;
let articleMainButtonContent = null;
Expand Down Expand Up @@ -378,7 +377,6 @@ class PageLayout extends React.Component {
autoFocus={isMobile || isTabletView ? false : true}
pinned={isArticlePinned}
viewAs={viewAs}
isLoadingContent={isLoadingContent}
>
{isSectionFilterAvailable && (
<SubSectionFilter className="section-body_filter">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import Scrollbar from "@appserver/components/scrollbar";
import DragAndDrop from "@appserver/components/drag-and-drop";
import { tablet, desktop } from "@appserver/components/utils/device";

const paddingStyles = css`
padding: 17px 7px 16px 24px;
@media ${tablet} {
padding: 16px 0 16px 24px;
}
`;
const commonStyles = css`
flex-grow: 1;
${(props) => !props.withScroll && `height: 100%;`}
Expand All @@ -18,20 +24,15 @@ const commonStyles = css`
-webkit-user-select: none;
.section-wrapper {
${(props) => !props.withScroll && `display: flex; height: 100%;`}
${(props) =>
!props.withScroll &&
`display: flex; height: 100%; box-sizing:border-box`};
${(props) => !props.withScroll && paddingStyles}
}
.section-wrapper-content {
${(props) =>
!props.withScroll &&
` height: 100%;
box-sizing: border-box;
`}
padding: 17px 7px 16px 24px;
${(props) =>
!props.isLoadingContent &&
css`
flex: 1 0 auto;
${paddingStyles}
flex: 1 0 auto;
outline: none;
${(props) =>
Expand All @@ -41,19 +42,15 @@ const commonStyles = css`
padding-left: 20px;
`}
.section-wrapper {
display: flex;
flex-direction: column;
min-height: 100%;
}
.section-wrapper {
display: flex;
flex-direction: column;
min-height: 100%;
}
.people-row-container,
.files-row-container {
margin-top: -22px;
}
`}
@media ${tablet} {
padding: 16px 0 16px 24px;
.people-row-container,
.files-row-container {
margin-top: -22px;
}
.section-wrapper {
Expand Down Expand Up @@ -147,7 +144,6 @@ class SectionBody extends React.Component {
viewAs,
withScroll,
isLoaded,
isLoadingContent,
} = this.props;
console.log("isLoaded", isLoaded);
const focusProps = autoFocus
Expand Down Expand Up @@ -198,7 +194,6 @@ class SectionBody extends React.Component {
withScroll={withScroll}
pinned={pinned}
isLoaded={isLoaded}
isLoadingContent={isLoadingContent}
>
{withScroll ? (
!isMobile ? (
Expand All @@ -220,7 +215,7 @@ class SectionBody extends React.Component {
)
) : (
<div className="section-wrapper">
<div className="section-wrapper-content">{children}</div>
{children}
{/* <StyledSpacer pinned={pinned} /> */}
</div>
)}
Expand All @@ -244,15 +239,13 @@ SectionBody.propTypes = {
]),
viewAs: PropTypes.string,
isLoaded: PropTypes.bool,
isLoadingContent: PropTypes.bool,
};

SectionBody.defaultProps = {
autoFocus: false,
pinned: false,
uploadFiles: false,
withScroll: true,
isLoadingContent: false,
};

export default inject(({ auth }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class PureVersionHistory extends React.Component {
secondaryProgressBarIcon="file"
showSecondaryButtonAlert={false}
withBodyScroll={false}
isLoadingContent={isLoading}
>
<PageLayout.ArticleHeader>
<ArticleHeaderContent />
Expand Down

0 comments on commit 6cf7c6d

Please sign in to comment.