mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-27 12:39:49 +01:00
feat: testing filters
This commit is contained in:
1 parent
bdaf6e662c
commit
547381286e
1 file changed
+51
@@ -34,6 +34,8 @@ import { GunAutoreloaderIcon } from "../../GunAutoreloaderIcon";
|
|||||||
import { GunRegularIcon } from "../../GunRegularIcon";
|
import { GunRegularIcon } from "../../GunRegularIcon";
|
||||||
import { MissingShellIcon } from "../../MissingShellIcon";
|
import { MissingShellIcon } from "../../MissingShellIcon";
|
||||||
import { ResearchedIcon } from "../../ResearchedIcon";
|
import { ResearchedIcon } from "../../ResearchedIcon";
|
||||||
|
import { ScienceIcon } from "../../ScienceIcon";
|
||||||
|
import { ScienceOffIcon } from "../../ScienceOffIcon";
|
||||||
|
|
||||||
const gameDefinitions = await awaitableGameDefinitions;
|
const gameDefinitions = await awaitableGameDefinitions;
|
||||||
|
|
||||||
@@ -77,6 +79,7 @@ export function FilterControl() {
|
|||||||
<GunTypeFilter />
|
<GunTypeFilter />
|
||||||
<ShellFilter />
|
<ShellFilter />
|
||||||
<OwnershipFilter />
|
<OwnershipFilter />
|
||||||
|
<TestFilter />
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -655,3 +658,51 @@ function OwnershipFilterInternal(props: FlexProps) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function TestFilter() {
|
||||||
|
const showTesting = TankFilters.use((state) => state.showTesting);
|
||||||
|
const showNonTesting = TankFilters.use((state) => state.showNonTesting);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Flex>
|
||||||
|
<IconButton
|
||||||
|
style={{
|
||||||
|
borderTopRightRadius: 0,
|
||||||
|
borderBottomRightRadius: 0,
|
||||||
|
}}
|
||||||
|
variant={showNonTesting ? "solid" : "surface"}
|
||||||
|
color={showNonTesting ? undefined : "gray"}
|
||||||
|
highContrast
|
||||||
|
onClick={() => {
|
||||||
|
TankFilters.mutate((draft) => {
|
||||||
|
draft.showNonTesting = !draft.showNonTesting;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ScienceOffIcon
|
||||||
|
style={{ width: "1em", height: "1em", color: "currentColor" }}
|
||||||
|
/>
|
||||||
|
</IconButton>
|
||||||
|
|
||||||
|
<IconButton
|
||||||
|
style={{
|
||||||
|
borderTopLeftRadius: 0,
|
||||||
|
borderBottomLeftRadius: 0,
|
||||||
|
marginLeft: "-1px",
|
||||||
|
}}
|
||||||
|
variant={showTesting ? "solid" : "surface"}
|
||||||
|
color={showTesting ? undefined : "gray"}
|
||||||
|
highContrast
|
||||||
|
onClick={() => {
|
||||||
|
TankFilters.mutate((draft) => {
|
||||||
|
draft.showTesting = !draft.showTesting;
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ScienceIcon
|
||||||
|
style={{ width: "1em", height: "1em", color: "currentColor" }}
|
||||||
|
/>
|
||||||
|
</IconButton>
|
||||||
|
</Flex>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user