Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Greatly simplify stat reduction input
  • Loading branch information
regalijan committed Mar 16, 2024
1 parent 0fa0858 commit f648fe8
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion components/GameAppealCard.tsx
Expand Up @@ -14,6 +14,11 @@ import {
ModalFooter,
ModalHeader,
ModalOverlay,
NumberDecrementStepper,
NumberIncrementStepper,
NumberInput,
NumberInputField,
NumberInputStepper,
Stack,
StackDivider,
Text,
Expand Down Expand Up @@ -113,6 +118,18 @@ export default function (props: GameAppealProps & { port?: MessagePort }) {
</ModalHeader>
<ModalBody>
<VStack spacing={4}>
<NumberInput
max={10}
min={-10}
onChange={(_, n) => setPercentage(n)}
precision={0}
>
<NumberInputField />
<NumberInputStepper>
<NumberIncrementStepper />
<NumberDecrementStepper />
</NumberInputStepper>
</NumberInput>
<Input
onBeforeInput={(e) => {
const value = (e.target as EventTarget & { value: string })
Expand All @@ -122,7 +139,6 @@ export default function (props: GameAppealProps & { port?: MessagePort }) {
e.preventDefault();
}}
onChange={(e) => setPercentage(parseInt(e.target.value))}
pattern="/^-?\d{0,3}$/"
placeholder="Reduction factor"
/>
<Text alignSelf="start">Stat multiplication factors:</Text>
Expand Down

0 comments on commit f648fe8

Please sign in to comment.