Handlers for UserShort.

View user's profile picture.
Close #25, adds logic to hamburger.
This commit is contained in:
Paul
2021-08-09 15:51:22 +01:00
parent c8b5753211
commit f19e334d56
8 changed files with 74 additions and 14 deletions

View File

@@ -1,5 +1,8 @@
import { Menu } from "@styled-icons/boxicons-regular";
import styled, { css } from "styled-components";
import { isTouchscreenDevice } from "../../lib/isTouchscreenDevice";
interface Props {
borders?: boolean;
background?: boolean;
@@ -60,3 +63,19 @@ export default styled.div<Props>`
border-start-start-radius: 8px;
`}
`;
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>
);
}