Skip to content

Commit

Permalink
Label buttons correctly
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Boberg <git@axelboberg.se>
  • Loading branch information
axelboberg committed Apr 24, 2024
1 parent 2c3ce52 commit 65f7aa4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/button/app/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,18 @@ export default function App () {
bridge.items.stopItem(itemId)
}

const label = item ? (item?.data?.name || 'Unnamed') : 'Drop an item here'

return (
<>
<QueryPath path='play'>
<ItemDropArea onDrop={itemId => handleItemChange(itemId)}>
<ItemButton label={item?.data?.name || 'Drop an item here'} color={item?.data?.color} onClick={() => handlePlayItem()} />
<ItemButton label={label} color={item?.data?.color} onClick={() => handlePlayItem()} />
</ItemDropArea>
</QueryPath>
<QueryPath path='stop'>
<ItemDropArea onDrop={itemId => handleItemChange(itemId)}>
<ItemButton label={item?.data?.name || 'Drop an item here'} color={item?.data?.color} onClick={() => handleStopItem()} />
<ItemButton label={label} color={item?.data?.color} onClick={() => handleStopItem()} />
</ItemDropArea>
</QueryPath>
</>
Expand Down

0 comments on commit 65f7aa4

Please sign in to comment.