feat: add kmenu icon for mobile

This commit is contained in:
Max Richter
2025-11-12 16:12:57 +01:00
parent 7ad08daf80
commit 7dda2dd60d
6 changed files with 24 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import { menus } from "@islands/KMenu/commands.ts";
import { MenuEntry } from "@islands/KMenu/types.ts";
import * as icons from "@components/icons.tsx";
import { IS_BROWSER } from "$fresh/runtime.ts";
import { isKMenuOpen } from "@lib/kmenu.ts";
const KMenuEntry = (
{ entry, activeIndex, index }: {
entry: MenuEntry;
@@ -42,7 +43,7 @@ export const KMenu = (
const input = useRef<HTMLInputElement>(null);
const commandInput = useSignal("");
const visible = useSignal(false);
const visible = isKMenuOpen;
if (visible.value === false) {
setTimeout(() => {
activeMenuType.value = "main";

14
islands/KMenuButton.tsx Normal file
View File

@@ -0,0 +1,14 @@
import { Button } from "@components/Button.tsx";
import { IconMenu2 } from "@components/icons.tsx";
import { isKMenuOpen } from "@lib/kmenu.ts";
export default function KMenuButton() {
return (
<Button
class="fixed bottom-4 right-4 md:hidden bg-gray-800 text-white p-3 rounded-full shadow-lg z-50"
onClick={() => (isKMenuOpen.value = true)}
>
<IconMenu2 class="w-6 h-6" />
</Button>
);
}