2021-08-09 15:51:22 +01:00
|
|
|
import { Menu } from "@styled-icons/boxicons-regular";
|
2021-06-19 15:29:04 +01:00
|
|
|
import styled, { css } from "styled-components";
|
|
|
|
|
2021-08-09 15:51:22 +01:00
|
|
|
import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice";
|
|
|
|
|
2021-06-19 15:29:04 +01:00
|
|
|
interface Props {
|
2021-07-05 11:25:20 +01:00
|
|
|
borders?: boolean;
|
|
|
|
background?: boolean;
|
|
|
|
placement: "primary" | "secondary";
|
2021-06-19 15:29:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export default styled.div<Props>`
|
2021-12-20 13:37:21 +00:00
|
|
|
gap: 10px;
|
2021-07-05 11:25:20 +01:00
|
|
|
height: 48px;
|
|
|
|
flex: 0 auto;
|
|
|
|
display: flex;
|
|
|
|
flex-shrink: 0;
|
|
|
|
padding: 0 16px;
|
|
|
|
font-weight: 600;
|
|
|
|
user-select: none;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
background-size: cover !important;
|
|
|
|
background-position: center !important;
|
|
|
|
background-color: var(--primary-header);
|
|
|
|
|
|
|
|
svg {
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
2021-07-08 18:39:03 +02:00
|
|
|
.menu {
|
|
|
|
margin-inline-end: 8px;
|
|
|
|
color: var(--secondary-foreground);
|
|
|
|
}
|
|
|
|
|
2021-07-05 11:25:20 +01:00
|
|
|
/*@media only screen and (max-width: 768px) {
|
2021-07-02 11:39:07 +02:00
|
|
|
padding: 0 12px;
|
2021-07-03 16:40:56 +02:00
|
|
|
}*/
|
|
|
|
|
2021-08-30 18:01:32 +01:00
|
|
|
${() =>
|
|
|
|
isTouchscreenDevice &&
|
|
|
|
css`
|
|
|
|
height: 56px;
|
|
|
|
`}
|
2021-07-05 11:23:23 +01:00
|
|
|
|
2021-07-05 11:25:20 +01:00
|
|
|
${(props) =>
|
|
|
|
props.background &&
|
|
|
|
css`
|
|
|
|
height: 120px !important;
|
|
|
|
align-items: flex-end;
|
2021-07-05 11:23:23 +01:00
|
|
|
|
2021-07-05 11:25:20 +01:00
|
|
|
text-shadow: 0px 0px 1px black;
|
|
|
|
`}
|
2021-07-05 11:23:23 +01:00
|
|
|
|
2021-07-05 11:25:20 +01:00
|
|
|
${(props) =>
|
|
|
|
props.placement === "secondary" &&
|
|
|
|
css`
|
|
|
|
background-color: var(--secondary-header);
|
|
|
|
padding: 14px;
|
|
|
|
`}
|
2021-07-05 11:23:23 +01:00
|
|
|
|
|
|
|
${(props) =>
|
2021-07-05 11:25:20 +01:00
|
|
|
props.borders &&
|
|
|
|
css`
|
|
|
|
border-start-start-radius: 8px;
|
|
|
|
`}
|
2021-06-19 15:29:04 +01:00
|
|
|
`;
|
2021-08-09 15:51:22 +01:00
|
|
|
|
|
|
|
export function HamburgerAction() {
|
|
|
|
if (!isTouchscreenDevice) return null;
|
|
|
|
|
|
|
|
function openSidebar() {
|
|
|
|
document
|
|
|
|
.querySelector("#app > div > div")
|
|
|
|
?.scrollTo({ behavior: "smooth", left: 0 });
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="menu" onClick={openSidebar}>
|
|
|
|
<Menu size={27} />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|