2019-09-12 12:15:22 +00:00
|
|
|
import React from "react";
|
2020-08-31 07:03:19 +00:00
|
|
|
import styled, { css } from "styled-components";
|
2021-02-24 17:11:23 +00:00
|
|
|
import { tablet, size } from "@appserver/components/utils/device";
|
2021-01-20 18:04:00 +00:00
|
|
|
import {
|
|
|
|
isIOS,
|
|
|
|
isTablet,
|
|
|
|
isSafari,
|
|
|
|
isChrome,
|
|
|
|
isMobile,
|
|
|
|
} from "react-device-detect";
|
2019-07-20 09:48:29 +00:00
|
|
|
|
2020-08-31 07:03:19 +00:00
|
|
|
const tabletProps = css`
|
|
|
|
.section-header_filter {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.section-body_filter {
|
|
|
|
display: block;
|
2020-10-26 11:24:09 +00:00
|
|
|
margin: 0 0 25px;
|
2020-08-31 07:03:19 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-07-20 09:48:29 +00:00
|
|
|
const StyledSection = styled.section`
|
2019-12-23 13:41:52 +00:00
|
|
|
padding: 0 0 0 24px;
|
2019-07-20 09:48:29 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-11-25 10:30:12 +00:00
|
|
|
//width: ${(props) => `${props.widthProp}px`};
|
2020-04-28 14:41:34 +00:00
|
|
|
.layout-progress-bar {
|
2020-11-24 14:04:42 +00:00
|
|
|
position: fixed;
|
|
|
|
right: 15px;
|
|
|
|
bottom: 21px;
|
2020-10-16 12:38:04 +00:00
|
|
|
|
2020-09-18 12:45:21 +00:00
|
|
|
@media ${tablet} {
|
2020-11-19 13:12:07 +00:00
|
|
|
bottom: 83px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.layout-progress-second-bar {
|
2020-11-24 14:04:42 +00:00
|
|
|
position: fixed;
|
|
|
|
right: 15px;
|
|
|
|
bottom: 83px;
|
2020-11-19 13:12:07 +00:00
|
|
|
|
|
|
|
@media ${tablet} {
|
|
|
|
bottom: 145px;
|
2020-09-18 12:45:21 +00:00
|
|
|
}
|
2020-04-28 14:41:34 +00:00
|
|
|
}
|
|
|
|
|
2020-02-12 12:26:16 +00:00
|
|
|
.section-header_filter {
|
2020-10-16 12:38:04 +00:00
|
|
|
display: block;
|
|
|
|
}
|
2020-02-12 12:26:16 +00:00
|
|
|
|
2020-10-16 12:38:04 +00:00
|
|
|
.section-body_filter {
|
|
|
|
display: none;
|
|
|
|
}
|
2019-12-23 13:41:52 +00:00
|
|
|
@media ${tablet} {
|
|
|
|
padding: 0 0 0 16px;
|
2020-08-31 07:03:19 +00:00
|
|
|
${tabletProps};
|
2019-12-23 13:41:52 +00:00
|
|
|
}
|
2021-03-15 13:02:26 +00:00
|
|
|
${
|
|
|
|
isMobile &&
|
|
|
|
css`
|
|
|
|
${tabletProps};
|
|
|
|
min-width: 100px;
|
|
|
|
`
|
|
|
|
}
|
2019-07-20 09:48:29 +00:00
|
|
|
`;
|
|
|
|
|
2019-07-28 20:39:59 +00:00
|
|
|
class Section extends React.Component {
|
|
|
|
/*shouldComponentUpdate() {
|
|
|
|
return false;
|
|
|
|
}*/
|
2020-12-18 17:16:13 +00:00
|
|
|
componentDidUpdate() {
|
|
|
|
const { pinned } = this.props;
|
|
|
|
|
2020-12-21 07:44:40 +00:00
|
|
|
if (
|
2020-12-21 08:13:56 +00:00
|
|
|
isIOS &&
|
2020-12-21 07:46:35 +00:00
|
|
|
isTablet &&
|
2020-12-21 07:44:40 +00:00
|
|
|
(isSafari || isChrome) &&
|
|
|
|
window.innerWidth <= size.smallTablet &&
|
|
|
|
pinned
|
|
|
|
) {
|
2020-12-18 18:24:37 +00:00
|
|
|
this.props.unpinArticle();
|
2020-12-18 17:16:13 +00:00
|
|
|
}
|
|
|
|
}
|
2019-07-28 20:39:59 +00:00
|
|
|
render() {
|
2019-08-13 11:21:28 +00:00
|
|
|
//console.log("PageLayout Section render");
|
2020-12-18 17:16:13 +00:00
|
|
|
|
2019-09-12 12:15:22 +00:00
|
|
|
return <StyledSection {...this.props} />;
|
2019-09-10 07:03:36 +00:00
|
|
|
}
|
|
|
|
}
|
2019-07-20 09:48:29 +00:00
|
|
|
|
2019-09-12 12:15:22 +00:00
|
|
|
export default Section;
|