Skip to content

Commit

Permalink
✨ Restrict ability to add items to cargo based on ship location.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlee-dev committed Aug 21, 2019
1 parent c2ecec6 commit dc1f0cc
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/views/planets.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,22 @@ const PlanetsView = ({
<Box pad="medium">
<Text>Value: {value}</Text>
</Box>
<Box pad="medium">
<Button
hoverIndicator
icon={<Add />}
onClick={() =>
handleStoreCargo(item, storagePlanets, setStoragePlanets)
}
plain
/>
</Box>
{shipLocationValue === location && (
<Box pad="medium">
<Button
hoverIndicator
icon={<Add />}
onClick={() =>
handleStoreCargo(
item,
storagePlanets,
setStoragePlanets
)
}
plain
/>
</Box>
)}
</Box>
)
})}
Expand Down

0 comments on commit dc1f0cc

Please sign in to comment.