2019-09-12 12:15:22 +00:00
|
|
|
import React from "react";
|
|
|
|
import styled from "styled-components";
|
2019-12-20 11:35:53 +00:00
|
|
|
import { utils } from "asc-web-components";
|
|
|
|
const { tablet } = utils.device;
|
2019-07-20 09:48:29 +00:00
|
|
|
|
|
|
|
const StyledArticle = styled.article`
|
2019-12-23 13:41:52 +00:00
|
|
|
padding: 0 24px;
|
2019-09-12 12:15:22 +00:00
|
|
|
background: #f8f9f9;
|
2019-07-20 09:48:29 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
width: 264px;
|
|
|
|
min-width: 264px;
|
2020-08-31 07:03:19 +00:00
|
|
|
/*transition: width 0.3s ease-in-out;*/
|
2019-07-20 09:48:29 +00:00
|
|
|
overflow: hidden auto;
|
2019-12-05 13:13:40 +00:00
|
|
|
box-sizing: border-box;
|
2020-08-31 07:03:19 +00:00
|
|
|
resize: horizontal;
|
2019-07-20 09:48:29 +00:00
|
|
|
|
2019-09-04 10:29:32 +00:00
|
|
|
@media ${tablet} {
|
2019-12-23 13:41:52 +00:00
|
|
|
padding: 0 16px;
|
2020-10-16 12:38:04 +00:00
|
|
|
${(props) =>
|
2019-09-12 12:15:22 +00:00
|
|
|
props.visible
|
|
|
|
? props.pinned
|
|
|
|
? `
|
2019-07-20 09:48:29 +00:00
|
|
|
display: flex;
|
|
|
|
width: 240px;
|
|
|
|
min-width: 240px;
|
|
|
|
`
|
2019-09-12 12:15:22 +00:00
|
|
|
: `
|
2019-07-20 09:48:29 +00:00
|
|
|
width: 240px;
|
|
|
|
min-width: 240px;
|
2020-08-31 07:03:19 +00:00
|
|
|
max-width: 240px;
|
2019-07-20 09:48:29 +00:00
|
|
|
position: fixed;
|
|
|
|
height: 100%;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
z-index: 400;
|
2020-08-31 07:03:19 +00:00
|
|
|
resize: none;
|
2019-07-20 09:48:29 +00:00
|
|
|
`
|
2019-09-12 12:15:22 +00:00
|
|
|
: `
|
2019-11-27 12:49:01 +00:00
|
|
|
width: 240px;
|
|
|
|
min-width: 240px;
|
2020-08-31 07:03:19 +00:00
|
|
|
max-width: 240px;
|
2019-11-27 12:49:01 +00:00
|
|
|
position: fixed;
|
|
|
|
height: 100%;
|
|
|
|
top: 0;
|
|
|
|
left: -240px;
|
|
|
|
z-index: 400;
|
2020-08-31 07:03:19 +00:00
|
|
|
resize: none;
|
2019-09-12 12:15:22 +00:00
|
|
|
`}
|
2019-07-20 09:48:29 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-07-28 20:39:59 +00:00
|
|
|
class Article extends React.Component {
|
2019-08-13 11:36:37 +00:00
|
|
|
/*shouldComponentUpdate() {
|
2019-07-28 20:39:59 +00:00
|
|
|
return false;
|
2019-08-13 11:36:37 +00:00
|
|
|
}*/
|
2019-07-28 20:39:59 +00:00
|
|
|
|
|
|
|
render() {
|
2019-08-13 11:21:28 +00:00
|
|
|
//console.log("PageLayout Article render");
|
2019-09-12 12:15:22 +00:00
|
|
|
return <StyledArticle {...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 Article;
|