2019-09-12 12:15:22 +00:00
|
|
|
import React from "react";
|
|
|
|
import PropTypes from "prop-types";
|
|
|
|
import styled from "styled-components";
|
2021-02-24 17:11:23 +00:00
|
|
|
import { tablet } from "@appserver/components/utils/device";
|
2021-02-25 14:20:11 +00:00
|
|
|
import CatalogButtonIcon from "../../../../../public/images/catalog.button.react.svg";
|
2019-07-20 09:48:29 +00:00
|
|
|
|
|
|
|
const StyledSectionToggler = styled.div`
|
|
|
|
height: 64px;
|
2019-11-14 12:13:54 +00:00
|
|
|
position: fixed;
|
|
|
|
bottom: 0;
|
2020-10-26 10:02:52 +00:00
|
|
|
right: 16px;
|
2019-07-20 09:48:29 +00:00
|
|
|
display: none;
|
2020-02-07 15:24:30 +00:00
|
|
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
2019-07-20 09:48:29 +00:00
|
|
|
|
2019-09-04 10:29:32 +00:00
|
|
|
@media ${tablet} {
|
2020-10-16 12:38:04 +00:00
|
|
|
display: ${(props) => (props.visible ? "block" : "none")};
|
2019-07-20 09:48:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
div {
|
|
|
|
width: 48px;
|
|
|
|
height: 48px;
|
2019-12-23 13:25:29 +00:00
|
|
|
padding: 14px 12px 14px 16px;
|
2019-07-20 09:48:29 +00:00
|
|
|
box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.13);
|
|
|
|
border-radius: 48px;
|
|
|
|
cursor: pointer;
|
2019-11-14 12:13:54 +00:00
|
|
|
background: #fff;
|
2019-12-05 13:13:40 +00:00
|
|
|
box-sizing: border-box;
|
2019-12-23 13:25:29 +00:00
|
|
|
line-height: 14px;
|
2019-07-20 09:48:29 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-12-23 13:25:29 +00:00
|
|
|
const iconStyle = {
|
|
|
|
width: "20px",
|
|
|
|
height: "20px",
|
|
|
|
minWidth: "20px",
|
2020-10-16 12:38:04 +00:00
|
|
|
minHeight: "20px",
|
2019-12-23 13:25:29 +00:00
|
|
|
};
|
|
|
|
|
2020-10-16 12:38:04 +00:00
|
|
|
const SectionToggler = React.memo((props) => {
|
2019-08-13 11:21:28 +00:00
|
|
|
//console.log("PageLayout SectionToggler render");
|
2019-07-20 09:48:29 +00:00
|
|
|
const { visible, onClick } = props;
|
|
|
|
|
|
|
|
return (
|
2021-05-13 13:57:10 +00:00
|
|
|
<StyledSectionToggler className="not-selectable" visible={visible}>
|
2019-07-20 09:48:29 +00:00
|
|
|
<div onClick={onClick}>
|
2020-11-26 16:40:54 +00:00
|
|
|
<CatalogButtonIcon style={iconStyle} />
|
2019-07-20 09:48:29 +00:00
|
|
|
</div>
|
|
|
|
</StyledSectionToggler>
|
|
|
|
);
|
2019-07-28 20:39:59 +00:00
|
|
|
});
|
2019-07-20 09:48:29 +00:00
|
|
|
|
2019-09-12 12:15:22 +00:00
|
|
|
SectionToggler.displayName = "SectionToggler";
|
|
|
|
|
|
|
|
SectionToggler.propTypes = {
|
|
|
|
visible: PropTypes.bool,
|
2020-10-16 12:38:04 +00:00
|
|
|
onClick: PropTypes.func,
|
2019-09-12 12:15:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default SectionToggler;
|