DocSpace-buildtools/web/ASC.Web.Components/src/components/page-layout/sub-comoponents/section-body.js

35 lines
741 B
JavaScript
Raw Normal View History

import React from "react";
import PropTypes from "prop-types";
import styled from "styled-components";
import Scrollbar from "../../scrollbar";
const StyledSectionBody = styled.div`
margin: 16px 0;
2019-07-29 12:51:56 +00:00
${props => props.displayBorder && `outline: 1px dotted;`}
flex-grow: 1;
`;
const SectionBody = React.memo(props => {
console.log("PageLayout SectionBody render");
const { children, withScroll } = props;
return (
<StyledSectionBody>
{withScroll
? <Scrollbar stype="mediumBlack">{children}</Scrollbar>
: <>{children}</>
}
</StyledSectionBody>
);
});
SectionBody.propTypes = {
withScroll: PropTypes.bool
};
SectionBody.defaultProps = {
withScroll: true
};
export default SectionBody;