mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: equipment preview
This commit is contained in:
1 parent
c1253e8121
commit
48603b918f
2 files changed
+61
-11
No files matched your search
@@ -1,11 +0,0 @@
|
|||||||
import { EquipmentMatrix } from '../stores/duel';
|
|
||||||
|
|
||||||
interface EquipmentMatrixCompactProps {
|
|
||||||
equipmentMatrix: EquipmentMatrix;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function EquipmentMatrixCompact({
|
|
||||||
equipmentMatrix,
|
|
||||||
}: EquipmentMatrixCompactProps) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
import { Button, Flex } from '@radix-ui/themes';
|
||||||
|
import { times } from 'lodash';
|
||||||
|
import { theme } from '../stitches.config';
|
||||||
|
import { EquipmentMatrix } from '../stores/duel';
|
||||||
|
|
||||||
|
interface EquipmentMatrixCompactProps {
|
||||||
|
equipmentMatrix: EquipmentMatrix;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function EquipmentMatrixCompact({
|
||||||
|
equipmentMatrix,
|
||||||
|
}: EquipmentMatrixCompactProps) {
|
||||||
|
return (
|
||||||
|
<Button variant="ghost">
|
||||||
|
<Flex gap="1" direction="column">
|
||||||
|
{times(3, (y) => (
|
||||||
|
<Flex
|
||||||
|
style={{
|
||||||
|
gap: 6,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{times(3, (x) => {
|
||||||
|
const equipment = equipmentMatrix[y][x];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Flex
|
||||||
|
style={{
|
||||||
|
gap: 2,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: 4,
|
||||||
|
height: 8,
|
||||||
|
backgroundColor:
|
||||||
|
equipment === -1
|
||||||
|
? theme.colors.textLowContrast_green
|
||||||
|
: theme.colors.textLowContrast,
|
||||||
|
borderRadius: 2,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: 4,
|
||||||
|
height: 8,
|
||||||
|
backgroundColor:
|
||||||
|
equipment === 1
|
||||||
|
? theme.colors.textLowContrast_green
|
||||||
|
: theme.colors.textLowContrast,
|
||||||
|
borderRadius: 2,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</Flex>
|
||||||
|
))}
|
||||||
|
</Flex>
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user