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";
|
2022-02-01 10:44:49 +00:00
|
|
|
import { tablet, size, mobile } from "@appserver/components/utils/device";
|
2021-01-20 18:04:00 +00:00
|
|
|
import {
|
|
|
|
isIOS,
|
|
|
|
isTablet,
|
|
|
|
isSafari,
|
|
|
|
isChrome,
|
2022-02-01 10:44:49 +00:00
|
|
|
isMobileOnly,
|
2021-01-20 18:04:00 +00:00
|
|
|
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;
|
2022-03-03 09:36:18 +00:00
|
|
|
margin: ${(props) => (props.viewAs === "tile" ? "0 0 18px" : "0 0 30px")};
|
2020-08-31 07:03:19 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2022-03-16 12:22:48 +00:00
|
|
|
const StyledSectionContainer = styled.section`
|
2022-03-03 07:04:54 +00:00
|
|
|
padding: 0 0 0 20px;
|
2019-07-20 09:48:29 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2022-02-01 08:17:37 +00:00
|
|
|
|
2022-03-18 10:43:16 +00:00
|
|
|
${(props) =>
|
|
|
|
props.maintenanceExist &&
|
|
|
|
isMobile &&
|
|
|
|
css`
|
|
|
|
.main-bar {
|
|
|
|
animation-name: slideDown;
|
|
|
|
-webkit-animation-name: slideDown;
|
|
|
|
|
|
|
|
animation-duration: 0.3s;
|
|
|
|
-webkit-animation-duration: 0.3s;
|
|
|
|
|
|
|
|
animation-timing-function: linear;
|
|
|
|
-webkit-animation-timing-function: linear;
|
|
|
|
|
|
|
|
visibility: visible !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes slideDown {
|
|
|
|
0% {
|
|
|
|
transform: translateY(-100%);
|
|
|
|
}
|
|
|
|
50% {
|
|
|
|
transform: translateY(-60%);
|
|
|
|
}
|
|
|
|
65% {
|
|
|
|
transform: translateY(-30%);
|
|
|
|
}
|
|
|
|
80% {
|
|
|
|
transform: translateY(-10%);
|
|
|
|
}
|
|
|
|
95% {
|
|
|
|
transform: translateY(-5%);
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
transform: translateY(0%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
|
2022-02-01 08:17:37 +00:00
|
|
|
.main-bar,
|
|
|
|
.main-bar--hidden {
|
|
|
|
${isMobile &&
|
|
|
|
css`
|
2022-03-16 12:01:26 +00:00
|
|
|
transition: top 0.3s cubic-bezier(0, 0, 0.8, 1);
|
|
|
|
-moz-transition: top 0.3s cubic-bezier(0, 0, 0.8, 1);
|
|
|
|
-ms-transition: top 0.3s cubic-bezier(0, 0, 0.8, 1);
|
|
|
|
-webkit-transition: top 0.3s cubic-bezier(0, 0, 0.8, 1);
|
|
|
|
-o-transition: top 0.3s cubic-bezier(0, 0, 0.8, 1);
|
2022-02-01 08:17:37 +00:00
|
|
|
`}
|
|
|
|
}
|
|
|
|
.main-bar--hidden {
|
|
|
|
${isMobile &&
|
|
|
|
css`
|
|
|
|
top: -140px;
|
|
|
|
`}
|
|
|
|
}
|
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
|
|
|
|
2021-10-25 09:20:08 +00:00
|
|
|
${(props) =>
|
|
|
|
!props.visible &&
|
|
|
|
css`
|
|
|
|
@media ${tablet} {
|
|
|
|
bottom: 83px;
|
|
|
|
}
|
|
|
|
`}
|
2020-11-19 13:12:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.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
|
|
|
|
2021-10-25 09:20:08 +00:00
|
|
|
${(props) =>
|
|
|
|
!props.visible &&
|
|
|
|
css`
|
|
|
|
@media ${tablet} {
|
|
|
|
bottom: 145px;
|
|
|
|
}
|
|
|
|
`}
|
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-10-25 09:20:08 +00:00
|
|
|
${isMobile &&
|
|
|
|
css`
|
|
|
|
${tabletProps};
|
|
|
|
min-width: 100px;
|
|
|
|
`}
|
2019-07-20 09:48:29 +00:00
|
|
|
`;
|
|
|
|
|
2022-03-16 12:22:48 +00:00
|
|
|
class SectionContainer extends React.Component {
|
2019-07-28 20:39:59 +00:00
|
|
|
/*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
|
|
|
|
2022-03-16 12:22:48 +00:00
|
|
|
return <StyledSectionContainer id="section" {...this.props} />;
|
2019-09-10 07:03:36 +00:00
|
|
|
}
|
|
|
|
}
|
2019-07-20 09:48:29 +00:00
|
|
|
|
2022-03-16 12:22:48 +00:00
|
|
|
export default SectionContainer;
|