switch to pretty-roact-hooks

This commit is contained in:
Reid 2023-08-20 20:03:30 -07:00
parent 057efc9a8c
commit 079af9709f
4 changed files with 25 additions and 20 deletions

View file

@ -5,7 +5,7 @@ import { ContextActionService, HttpService } from "@rbxts/services"
import Text from "ReplicatedStorage/ui/components/text"
import Surface from "ReplicatedStorage/ui/components/surface"
import { Spring } from "@rbxts/flipper"
import { useGroupMotor } from "@rbxts/roact-hooked-plus"
import { useMotor } from "@rbxts/pretty-roact-hooks"
interface SlotProps extends Roact.JsxInstanceProperties<Frame> {
index: number
@ -16,8 +16,8 @@ interface SlotProps extends Roact.JsxInstanceProperties<Frame> {
Change?: Roact.JsxInstanceChangeEvents<Frame>
}
const SLOT_DEFAULT = [new Spring(0, { frequency: 6 }), new Spring(6, { frequency: 6 })]
const SLOT_ACTIVE = [new Spring(1, { frequency: 6 }), new Spring(5, { frequency: 6 })]
const SLOT_DEFAULT = new Spring(6, { frequency: 6 })
const SLOT_ACTIVE = new Spring(5, { frequency: 6 })
function slot(props: SlotProps): Roact.Element {
const { index, keycode, tool } = props
@ -27,8 +27,7 @@ function slot(props: SlotProps): Roact.Element {
delete spreadableProps.keycode
delete spreadableProps.tool
const [slotBorderColorAndSlotRatio, setSlotGoal] = useGroupMotor([0, 6])
const slotRatio = slotBorderColorAndSlotRatio.map((t) => t[1])
const [slotRatio, setSlotGoal] = useMotor(0)
const { clientState } = useWorldContext()