2019-07-20 09:48:29 +00:00
|
|
|
import React from 'react'
|
|
|
|
import styled from 'styled-components'
|
2019-09-04 10:29:32 +00:00
|
|
|
import { tablet } from '../../../utils/device'
|
2019-07-20 09:48:29 +00:00
|
|
|
|
|
|
|
const StyledArticle = styled.article`
|
|
|
|
padding: 0 16px;
|
|
|
|
background: #F8F9F9;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
width: 264px;
|
|
|
|
min-width: 264px;
|
|
|
|
transition: width .3s ease-in-out;
|
|
|
|
overflow: hidden auto;
|
|
|
|
|
2019-09-04 10:29:32 +00:00
|
|
|
@media ${tablet} {
|
2019-07-20 09:48:29 +00:00
|
|
|
${props => props.visible
|
2019-07-28 20:39:59 +00:00
|
|
|
? props.pinned
|
|
|
|
? `
|
2019-07-20 09:48:29 +00:00
|
|
|
display: flex;
|
|
|
|
width: 240px;
|
|
|
|
min-width: 240px;
|
|
|
|
`
|
2019-07-28 20:39:59 +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-07-28 20:39:59 +00:00
|
|
|
: `
|
2019-07-20 09:48:29 +00:00
|
|
|
display: none;
|
|
|
|
width: 0px;
|
|
|
|
`
|
2019-07-28 20:39:59 +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-07-28 20:39:59 +00:00
|
|
|
return (
|
|
|
|
<StyledArticle {...this.props} />
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
2019-07-20 09:48:29 +00:00
|
|
|
|
|
|
|
export default Article;
|