2022-01-28 13:44:58 +00:00
|
|
|
import React from "react";
|
|
|
|
import PropTypes from "prop-types";
|
|
|
|
import styled from "styled-components";
|
|
|
|
import { tablet } from "@appserver/components/utils/device";
|
|
|
|
import CatalogButtonIcon from "../../../../../public/images/catalog.button.react.svg";
|
|
|
|
import Base from "@appserver/components/themes/base";
|
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} {
|
2022-01-28 13:44:58 +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;
|
2021-12-24 16:50:45 +00:00
|
|
|
box-shadow: ${(props) => props.theme.section.toggler.boxShadow};
|
2019-07-20 09:48:29 +00:00
|
|
|
border-radius: 48px;
|
|
|
|
cursor: pointer;
|
2021-12-24 16:50:45 +00:00
|
|
|
background: ${(props) => props.theme.section.toggler.background};
|
2019-12-05 13:13:40 +00:00
|
|
|
box-sizing: border-box;
|
2019-12-23 13:25:29 +00:00
|
|
|
line-height: 14px;
|
2021-12-28 08:47:44 +00:00
|
|
|
svg {
|
|
|
|
path {
|
2022-01-25 08:17:12 +00:00
|
|
|
fill: ${(props) => props.theme.section.toggler.fill};
|
2021-12-28 08:47:44 +00:00
|
|
|
}
|
|
|
|
}
|
2019-07-20 09:48:29 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2021-12-24 16:50:45 +00:00
|
|
|
StyledSectionToggler.defaultProps = { theme: Base };
|
|
|
|
|
2019-12-23 13:25:29 +00:00
|
|
|
const iconStyle = {
|
2022-01-28 13:44:58 +00:00
|
|
|
width: "20px",
|
|
|
|
height: "20px",
|
|
|
|
minWidth: "20px",
|
|
|
|
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
|
|
|
|
2022-01-28 13:44:58 +00:00
|
|
|
SectionToggler.displayName = "SectionToggler";
|
2019-09-12 12:15:22 +00:00
|
|
|
|
|
|
|
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;
|