Skip to content

Commit 3d366c7

Browse files
authored
Fix hotbar story
Signed-off-by: GitHub <noreply@github.com>
1 parent f4a26a7 commit 3d366c7

File tree

2 files changed

+14
-42
lines changed

2 files changed

+14
-42
lines changed

src/Components/Hotbar.luau

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
local React = require("../Packages/React")
22

3-
local Theme = require("../Theme")
4-
5-
export type Props = {}
6-
7-
local function HotbarFrame(props: Props)
3+
local function HotbarFrame(props: {
4+
child: () -> (),
5+
})
86
return React.createElement("Frame", {
97
AutomaticSize = Enum.AutomaticSize.XY,
10-
BackgroundTransparency = 1,
8+
-- BackgroundTransparency = 1,
119
}, {
1210
React.createElement("UIListLayout", {
1311
Padding = UDim.new(0, 5),
12+
FillDirection = Enum.FillDirection.Horizontal,
1413
VerticalAlignment = Enum.VerticalAlignment.Center,
1514
}),
1615
}, {
1716
React.createElement("UIPadding", {
18-
PaddingBottom = UDim.new(0, 5),
17+
PaddingBottom = UDim.new(0, 0),
1918
PaddingLeft = UDim.new(0, 5),
2019
PaddingRight = UDim.new(0, 5),
21-
PaddingTop = UDim.new(0, 5),
20+
PaddingTop = UDim.new(0, 0),
2221
}),
22+
}, {
23+
Child = props.child,
2324
})
2425
end
2526

src/Stories/Hotbar.story.luau

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,11 @@ return {
99
react = React,
1010
reactRoblox = ReactRoblox,
1111
story = function()
12-
return React.createElement(Hotbar, {}, {
13-
React.createElement(Slot, {
14-
toolName = "Sword",
15-
textureIcon = "rbxassetid://7743866529",
16-
tooltip = "A sharp blade",
17-
slotNumber = "1",
18-
equipped = true,
19-
paddingOffset = 0,
20-
Parent = script.Parent,
12+
return React.createElement(Hotbar, {
13+
child = React.createElement(Slot, {
14+
toolName = "Tool",
15+
slotNumber = "0",
2116
}),
22-
React.createElement(Slot, {
23-
toolName = "Bow",
24-
textureIcon = "rbxassetid://7743878358",
25-
tooltip = "For ranged attacks",
26-
slotNumber = "2",
27-
equipped = false,
28-
paddingOffset = 0,
29-
}),
30-
React.createElement(Slot, {
31-
toolName = "Shield",
32-
textureIcon = "rbxassetid://7743867987",
33-
tooltip = "Defensive item",
34-
slotNumber = "3",
35-
equipped = false,
36-
paddingOffset = 0,
37-
}),
38-
React.createElement(Slot, {
39-
toolName = "Potion",
40-
textureIcon = "rbxassetid://7743871218",
41-
tooltip = "Healing potion",
42-
slotNumber = "4",
43-
equipped = false,
44-
paddingOffset = 0,
45-
}),
46-
})
17+
}, {})
4718
end,
4819
}

0 commit comments

Comments
 (0)