Skip to content

Commit 1d8ad18

Browse files
authored
Hide slot text if no image
Signed-off-by: GitHub <noreply@github.com>
1 parent 8a3afde commit 1d8ad18

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Components/Slot.luau

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export type Props = {
1717
}
1818

1919
local function SlotButton(props: Props)
20+
-- Generate tags based on state
2021
local tags = "Slot"
2122
if props.unlocked then
2223
tags = tags .. " Unlocked"
@@ -25,7 +26,11 @@ local function SlotButton(props: Props)
2526
tags = tags .. " Equipped"
2627
end
2728

28-
local slotText = if props.toolImage == nil or "" then "" else props.toolName or ""
29+
-- Hide the name if there is an image
30+
local slotText = props.toolName
31+
if props.toolImage and props.toolImage ~= "" then
32+
slotText = ""
33+
end
2934

3035
return React.createElement("TextButton", {
3136
Text = slotText,

0 commit comments

Comments
 (0)