2019-09-12 12:15:22 +00:00
|
|
|
import React from "react";
|
|
|
|
import styled from "styled-components";
|
|
|
|
import { tablet } from "../../../utils/device";
|
2019-07-20 09:48:29 +00:00
|
|
|
|
|
|
|
const StyledArticle = styled.article`
|
|
|
|
padding: 0 16px;
|
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;
|
2019-09-12 12:15:22 +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;
|
2019-07-20 09:48:29 +00:00
|
|
|
|
2019-09-04 10:29:32 +00:00
|
|
|
@media ${tablet} {
|
2019-09-12 12:15:22 +00:00
|
|
|
${props =>
|
|
|
|
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;
|
|
|
|
position: fixed;
|
|
|
|
height: 100%;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
z-index: 400;
|
|
|
|
`
|
2019-09-12 12:15:22 +00:00
|
|
|
: `
|
2019-11-27 12:49:01 +00:00
|
|
|
width: 240px;
|
|
|
|
min-width: 240px;
|
|
|
|
position: fixed;
|
|
|
|
height: 100%;
|
|
|
|
top: 0;
|
|
|
|
left: -240px;
|
|
|
|
z-index: 400;
|
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;
|