mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: compare equalize
This commit is contained in:
1 parent
71caa2f703
commit
655b87d876
3 files changed
+30
-3
No files matched your search
@@ -1291,7 +1291,8 @@
|
|||||||
},
|
},
|
||||||
"skills": {
|
"skills": {
|
||||||
"clear": "Clear",
|
"clear": "Clear",
|
||||||
"maximize": "Maximize"
|
"maximize": "Maximize",
|
||||||
|
"equalize": "Equalize"
|
||||||
},
|
},
|
||||||
"modules": {
|
"modules": {
|
||||||
"stock": "Stock",
|
"stock": "Stock",
|
||||||
|
|||||||
@@ -1,7 +1,15 @@
|
|||||||
import { asset, availableProvisions, permanentSkills } from "@blitzkit/core";
|
import { asset, availableProvisions, permanentSkills } from "@blitzkit/core";
|
||||||
import { checkConsumableProvisionInclusivity } from "@blitzkit/core/src/blitzkit/checkConsumableProvisionInclusivity";
|
import { checkConsumableProvisionInclusivity } from "@blitzkit/core/src/blitzkit/checkConsumableProvisionInclusivity";
|
||||||
import { ComponentPlaceholderIcon } from "@radix-ui/react-icons";
|
import { ComponentPlaceholderIcon } from "@radix-ui/react-icons";
|
||||||
import { Button, Flex, IconButton, Popover, Table } from "@radix-ui/themes";
|
import {
|
||||||
|
Button,
|
||||||
|
Flex,
|
||||||
|
IconButton,
|
||||||
|
Popover,
|
||||||
|
Switch,
|
||||||
|
Table,
|
||||||
|
Text,
|
||||||
|
} from "@radix-ui/themes";
|
||||||
import { times } from "lodash-es";
|
import { times } from "lodash-es";
|
||||||
import { awaitableConsumableDefinitions } from "../../core/awaitables/consumableDefinitions";
|
import { awaitableConsumableDefinitions } from "../../core/awaitables/consumableDefinitions";
|
||||||
import { awaitableEquipmentDefinitions } from "../../core/awaitables/equipmentDefinitions";
|
import { awaitableEquipmentDefinitions } from "../../core/awaitables/equipmentDefinitions";
|
||||||
@@ -44,6 +52,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
const crewSkills = CompareEphemeral.use((state) => state.crewSkills);
|
const crewSkills = CompareEphemeral.use((state) => state.crewSkills);
|
||||||
const members = CompareEphemeral.use((state) => state.members);
|
const members = CompareEphemeral.use((state) => state.members);
|
||||||
const { unwrap, strings } = useLocale();
|
const { unwrap, strings } = useLocale();
|
||||||
|
const equalize = CompareEphemeral.use((state) => state.equalize);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StickyTableRoot
|
<StickyTableRoot
|
||||||
@@ -80,10 +89,12 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.Cell style={{ height: "100%" }}>
|
<Table.Cell style={{ height: "100%" }}>
|
||||||
<Flex
|
<Flex
|
||||||
|
gap="2"
|
||||||
style={{
|
style={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
}}
|
}}
|
||||||
|
direction="column"
|
||||||
align="center"
|
align="center"
|
||||||
justify="center"
|
justify="center"
|
||||||
>
|
>
|
||||||
@@ -155,6 +166,21 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
</Popover.Content>
|
</Popover.Content>
|
||||||
</Popover.Root>
|
</Popover.Root>
|
||||||
|
|
||||||
|
<Flex align="center" gap="1">
|
||||||
|
<Text>
|
||||||
|
{strings.website.tools.compare.table.skills.equalize}
|
||||||
|
</Text>
|
||||||
|
<Switch
|
||||||
|
size="1"
|
||||||
|
checked={equalize}
|
||||||
|
onCheckedChange={(checked) => {
|
||||||
|
CompareEphemeral.mutate((draft) => {
|
||||||
|
draft.equalize = checked;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ function Content() {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
[members, crewSkills],
|
[members, crewSkills, equalize],
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in new issue
Block a user