fix: some small style things

This commit is contained in:
2023-08-02 13:25:19 +02:00
parent c7bcc0415a
commit 2d56710223
4 changed files with 24 additions and 6 deletions

View File

@ -1,16 +1,32 @@
import type { Signal } from "@preact/signals";
import { Button } from "@components/Button.tsx";
import { IconCircleMinus, IconCirclePlus } from "@components/icons.tsx";
interface CounterProps {
count: Signal<number>;
}
export default function Counter(props: CounterProps) {
props.count.value = Math.max(1, props.count.value);
return (
<div class="flex gap-2 items-center">
<Button onClick={() => props.count.value -= 1}>-</Button>
<p class="text-3xl">{props.count}</p>
<Button onClick={() => props.count.value += 1}>+</Button>
<div class="flex items-center px-1 py-2 rounded-xl">
<Button
class=""
onClick={() => props.count.value -= 1}
>
<IconCircleMinus />
</Button>
<input
class="text-3xl bg-transparent inline text-center -mx-4"
size={props.count.toString().length}
value={props.count}
onInput={(ev) => props.count.value = ev.target?.value}
>
{props.count}
</input>
<Button onClick={() => props.count.value += 1}>
<IconCirclePlus />
</Button>
</div>
);
}

View File

@ -39,7 +39,7 @@ export const KMenu = (
const input = useRef<HTMLInputElement>(null);
const commandInput = useSignal("");
const visible = useSignal(true);
const visible = useSignal(false);
if (visible.value === false) {
setTimeout(() => {
activeMenuType.value = "main";