Merge pull request #3616 from jaype87/dev

UI: Sort and color Graft Augmentation list
This commit is contained in:
hydroflame 2022-05-13 11:08:04 -04:00 committed by GitHub
commit abd66ad977
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -95,9 +95,19 @@ export const GraftingRoot = (): React.ReactElement => {
{getGraftingAvailableAugs(player).length > 0 ? ( {getGraftingAvailableAugs(player).length > 0 ? (
<Paper sx={{ my: 1, width: "fit-content", display: "grid", gridTemplateColumns: "1fr 3fr" }}> <Paper sx={{ my: 1, width: "fit-content", display: "grid", gridTemplateColumns: "1fr 3fr" }}>
<List sx={{ height: 400, overflowY: "scroll", borderRight: `1px solid ${Settings.theme.welllight}` }}> <List sx={{ height: 400, overflowY: "scroll", borderRight: `1px solid ${Settings.theme.welllight}` }}>
{getGraftingAvailableAugs(player).map((k, i) => ( {getGraftingAvailableAugs(player)
.sort((a, b) => GraftableAugmentations[a].cost - GraftableAugmentations[b].cost)
.map((k, i) => (
<ListItemButton key={i + 1} onClick={() => setSelectedAug(k)} selected={selectedAug === k}> <ListItemButton key={i + 1} onClick={() => setSelectedAug(k)} selected={selectedAug === k}>
<Typography>{k}</Typography> <Typography
sx={{
color: canGraft(player, GraftableAugmentations[k])
? Settings.theme.primary
: Settings.theme.disabled,
}}
>
{k}
</Typography>
</ListItemButton> </ListItemButton>
))} ))}
</List> </List>