Skip to content

Commit 5ac1995

Browse files
committed
Fix using key prop
Signed-off-by: Ryan Luu <ryan.luu@ryanluu.dev>
1 parent 67f079c commit 5ac1995

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎src/Components/Hotbar.luau‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ local function Hotbar(props: Props)
1515
local children = {
1616
-- Create default hints for equipping between hotbar slots
1717
SlotLeftHint = React.createElement(HotbarHint, {
18-
key = Enum.KeyCode.ButtonL1,
18+
keyCode = Enum.KeyCode.ButtonL1,
1919
forceVisible = props.forceHintVisible,
2020
order = -1,
2121
}),
2222
SlotRightHint = React.createElement(HotbarHint, {
23-
key = Enum.KeyCode.ButtonR1,
23+
keyCode = Enum.KeyCode.ButtonR1,
2424
forceVisible = props.forceHintVisible,
2525
order = 100,
2626
}),

‎src/Components/HotbarHint.luau‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local UserInputService = game:GetService("UserInputService")
55
local React = require(script.Parent.Parent.Parent.react)
66

77
export type Props = {
8-
key: Enum.KeyCode,
8+
keyCode: Enum.KeyCode,
99
forceVisible: boolean?,
1010
order: number?,
1111
}
@@ -38,7 +38,7 @@ local function HotbarHint(props: Props)
3838
local visible = props.forceVisible or isGamepadPreferred
3939

4040
return React.createElement("ImageLabel", {
41-
Image = UserInputService:GetImageForKeyCode(props.key),
41+
Image = UserInputService:GetImageForKeyCode(props.keyCode),
4242
LayoutOrder = props.order,
4343
Visible = visible,
4444
[React.Tag] = "HintSlot",

‎src/Components/HotbarHint.story.luau‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ return {
1515
controls = controls,
1616
story = function(props: Props)
1717
return React.createElement(HotbarHint, {
18-
key = Enum.KeyCode.ButtonX,
18+
keyCode = Enum.KeyCode.ButtonX,
1919
forceVisible = props.controls.forceVisible,
2020
})
2121
end,

0 commit comments

Comments
 (0)