2024-01-30 09:52:24 +00:00
|
|
|
import { FC } from "react";
|
2024-03-06 13:09:14 +00:00
|
|
|
import { observer } from "mobx-react";
|
2024-01-30 09:52:24 +00:00
|
|
|
import { Menu } from "lucide-react";
|
2024-03-19 14:38:35 +00:00
|
|
|
import { useApplication } from "@/hooks/store";
|
2024-01-30 09:52:24 +00:00
|
|
|
|
2024-02-14 09:25:33 +00:00
|
|
|
type Props = {
|
|
|
|
onClick?: () => void;
|
2024-02-28 14:25:22 +00:00
|
|
|
};
|
2024-02-14 09:25:33 +00:00
|
|
|
|
|
|
|
export const SidebarHamburgerToggle: FC<Props> = observer((props) => {
|
2024-02-28 14:25:22 +00:00
|
|
|
const { onClick } = props;
|
2024-02-14 09:25:33 +00:00
|
|
|
const { theme: themeStore } = useApplication();
|
2024-01-30 09:52:24 +00:00
|
|
|
return (
|
|
|
|
<div
|
2024-02-12 11:31:58 +00:00
|
|
|
className="w-7 h-7 flex-shrink-0 rounded flex justify-center items-center bg-custom-background-80 transition-all hover:bg-custom-background-90 cursor-pointer group md:hidden"
|
2024-02-14 09:25:33 +00:00
|
|
|
onClick={() => {
|
2024-02-28 14:25:22 +00:00
|
|
|
if (onClick) onClick();
|
|
|
|
else themeStore.toggleSidebar();
|
2024-02-14 09:25:33 +00:00
|
|
|
}}
|
2024-01-30 09:52:24 +00:00
|
|
|
>
|
|
|
|
<Menu size={14} className="text-custom-text-200 group-hover:text-custom-text-100 transition-all" />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
});
|