feat: trying to add hashes to scripts
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { Signal } from "@preact/signals";
|
||||
import { Button } from "@components/Button.tsx";
|
||||
import { IconCircleMinus, IconCirclePlus } from "@components/icons.tsx";
|
||||
import { TbCircleMinus, TbCirclePlus } from "@preact-icons/tb";
|
||||
|
||||
interface CounterProps {
|
||||
count: Signal<number>;
|
||||
@@ -14,17 +14,20 @@ export default function Counter(props: CounterProps) {
|
||||
class=""
|
||||
onClick={() => props.count.value -= 1}
|
||||
>
|
||||
<IconCircleMinus />
|
||||
<TbCircleMinus />
|
||||
</Button>
|
||||
<input
|
||||
class="text-3xl bg-transparent inline text-center -mx-4"
|
||||
type="number"
|
||||
size={props.count.toString().length}
|
||||
value={props.count}
|
||||
onInput={(ev) => props.count.value = ev.target?.value}
|
||||
onInput={(ev) => {
|
||||
const target = ev.target as HTMLInputElement;
|
||||
props.count.value = Math.max(1, Number(target.value));
|
||||
}}
|
||||
/>
|
||||
<Button onClick={() => props.count.value += 1}>
|
||||
<IconCirclePlus />
|
||||
<TbCirclePlus />
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user