feat: crew actions

This commit is contained in:
TrèsAbhi committed 2024-04-09 09:56:31 -05:00
1 parent e9a61d579d
commit 74756ab7bf
1 file changed
+37 -2
+37 -2
View File
@@ -54,6 +54,7 @@ import {
useCompareTemporary, useCompareTemporary,
} from '../../../stores/compare'; } from '../../../stores/compare';
import { EquipmentMatrix } from '../../../stores/duel'; import { EquipmentMatrix } from '../../../stores/duel';
import { permanentSkills } from '../tankopedia/[id]/components/Characteristics/components/Skills/constants';
import { TankSearch } from '../tankopedia/components/TankSearch'; import { TankSearch } from '../tankopedia/components/TankSearch';
import { TankControl } from './components/TankControl'; import { TankControl } from './components/TankControl';
@@ -509,8 +510,11 @@ export default function Page() {
backgroundColor: backgroundColor:
crewSkills[skill] === 0 crewSkills[skill] === 0
? theme.colors.textLowContrast ? theme.colors.textLowContrast
: theme.colors : permanentSkills.includes(skill)
.textLowContrast_crimson, ? theme.colors
.textLowContrast_crimson
: theme.colors
.textLowContrast_amber,
}} }}
/> />
))} ))}
@@ -529,6 +533,37 @@ export default function Page() {
}); });
}} }}
/> />
<Flex justify="end" mt="4" gap="4">
<Button
variant="ghost"
onClick={() => {
mutateCompareTemporary((draft) => {
Object.keys(draft.crewSkills).forEach(
(skill) => {
draft.crewSkills[skill] = 0;
},
);
});
}}
>
Clear
</Button>
<Button
variant="ghost"
onClick={() => {
mutateCompareTemporary((draft) => {
Object.keys(draft.crewSkills).forEach(
(skill) => {
draft.crewSkills[skill] = 7;
},
);
});
}}
>
Maximize
</Button>
</Flex>
</Popover.Content> </Popover.Content>
</Popover.Root> </Popover.Root>
</Flex> </Flex>