fix: some small style things
This commit is contained in:
@ -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>
|
||||
);
|
||||
}
|
||||
|
@ -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";
|
||||
|
Reference in New Issue
Block a user