mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-28 04:59:50 +01:00
feat: characteristics section
This commit is contained in:
1 parent
876dee1870
commit
d45637a407
9 files changed
+36
-24
No files matched your search
@@ -509,7 +509,7 @@ export function CompareTable({ stats }: CompareTableProps) {
|
|||||||
<ConsumablesManager
|
<ConsumablesManager
|
||||||
consumables={consumablesList}
|
consumables={consumablesList}
|
||||||
selected={consumables}
|
selected={consumables}
|
||||||
onChange={(consumables) => {
|
onConsumablesChange={(consumables) => {
|
||||||
mutateCompareEphemeral((draft) => {
|
mutateCompareEphemeral((draft) => {
|
||||||
draft.members[index].consumables = consumables;
|
draft.members[index].consumables = consumables;
|
||||||
});
|
});
|
||||||
|
|||||||
+6
-1
@@ -10,7 +10,12 @@ export function ConfigurationChildWrapper({
|
|||||||
...props
|
...props
|
||||||
}: ConfigurationChildWrapperProps) {
|
}: ConfigurationChildWrapperProps) {
|
||||||
return (
|
return (
|
||||||
<Flex gap="2" direction="column" {...props}>
|
<Flex
|
||||||
|
gap="2"
|
||||||
|
direction="column"
|
||||||
|
align={{ initial: 'center', sm: 'start' }}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -77,11 +77,12 @@ export function Consumables() {
|
|||||||
hasConsumableDeliverySystem={hasConsumableDeliverySystem}
|
hasConsumableDeliverySystem={hasConsumableDeliverySystem}
|
||||||
hasHighEndConsumables={hasHighEndConsumables}
|
hasHighEndConsumables={hasHighEndConsumables}
|
||||||
timers
|
timers
|
||||||
onChange={(consumables) => {
|
onConsumablesChange={(consumables) => {
|
||||||
mutateDuel((draft) => {
|
mutateDuel((draft) => {
|
||||||
draft.protagonist.consumables = consumables;
|
draft.protagonist.consumables = consumables;
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
justify={{ initial: 'center', sm: 'start' }}
|
||||||
/>
|
/>
|
||||||
</ConfigurationChildWrapper>
|
</ConfigurationChildWrapper>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -214,9 +214,7 @@ export function Modules() {
|
|||||||
align="center"
|
align="center"
|
||||||
direction="column"
|
direction="column"
|
||||||
gap="2"
|
gap="2"
|
||||||
style={{
|
position="relative"
|
||||||
position: 'relative',
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{unlock.cost.value > 0 && (
|
{unlock.cost.value > 0 && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -12,11 +12,17 @@ export function CharacteristicsSection() {
|
|||||||
<Flex mt="4" px="4" style={{ boxSizing: 'border-box' }} gap="6">
|
<Flex mt="4" px="4" style={{ boxSizing: 'border-box' }} gap="6">
|
||||||
<Flex
|
<Flex
|
||||||
flexGrow="1"
|
flexGrow="1"
|
||||||
gap="6"
|
gap="9"
|
||||||
justify="center"
|
justify="center"
|
||||||
|
align={{ initial: 'center', sm: 'start' }}
|
||||||
direction={{ initial: 'column', sm: 'row' }}
|
direction={{ initial: 'column', sm: 'row' }}
|
||||||
>
|
>
|
||||||
<Flex direction="column" gap="4" maxWidth="21rem">
|
<Flex
|
||||||
|
direction="column"
|
||||||
|
gap="6"
|
||||||
|
maxWidth="21rem"
|
||||||
|
align={{ initial: 'center', sm: 'start' }}
|
||||||
|
>
|
||||||
<Heading>Configuration</Heading>
|
<Heading>Configuration</Heading>
|
||||||
<Modules />
|
<Modules />
|
||||||
<Equipment />
|
<Equipment />
|
||||||
@@ -27,14 +33,14 @@ export function CharacteristicsSection() {
|
|||||||
</Flex>
|
</Flex>
|
||||||
<Flex
|
<Flex
|
||||||
flexGrow="1"
|
flexGrow="1"
|
||||||
maxWidth={{
|
maxWidth={{ initial: '20rem', md: '40rem' }}
|
||||||
initial: 'unset',
|
|
||||||
md: '640px',
|
|
||||||
}}
|
|
||||||
direction="column"
|
direction="column"
|
||||||
gap="4"
|
gap="6"
|
||||||
|
width="100%"
|
||||||
>
|
>
|
||||||
<Heading>Characteristics</Heading>
|
<Heading align={{ initial: 'center', sm: 'left' }}>
|
||||||
|
Characteristics
|
||||||
|
</Heading>
|
||||||
<Characteristics />
|
<Characteristics />
|
||||||
</Flex>
|
</Flex>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export function GameModeSection() {
|
|||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
key={id}
|
key={id}
|
||||||
width="14rem"
|
width="16rem"
|
||||||
height="20rem"
|
height="20rem"
|
||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
direction="column"
|
direction="column"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export function MetaSection() {
|
|||||||
justify="center"
|
justify="center"
|
||||||
direction={{ initial: 'column', sm: 'row' }}
|
direction={{ initial: 'column', sm: 'row' }}
|
||||||
>
|
>
|
||||||
<Flex direction="column" minWidth="12rem">
|
<Flex direction="column" minWidth="15rem">
|
||||||
<Heading mb="2" align={{ initial: 'center', sm: 'left' }}>
|
<Heading mb="2" align={{ initial: 'center', sm: 'left' }}>
|
||||||
Overview
|
Overview
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|||||||
@@ -1,30 +1,31 @@
|
|||||||
import { Flex } from '@radix-ui/themes';
|
import { Flex, FlexProps } from '@radix-ui/themes';
|
||||||
import { ConsumableEntry } from '../core/blitzkit/consumableDefinitions';
|
import { ConsumableEntry } from '../core/blitzkit/consumableDefinitions';
|
||||||
import { ConsumableButton } from './ModuleButtons/ConsumableButton';
|
import { ConsumableButton } from './ModuleButtons/ConsumableButton';
|
||||||
|
|
||||||
interface ConsumablesManagerProps {
|
type ConsumablesManagerProps = FlexProps & {
|
||||||
consumables: ConsumableEntry[];
|
consumables: ConsumableEntry[];
|
||||||
selected: number[];
|
selected: number[];
|
||||||
onChange?: (consumables: number[]) => void;
|
onConsumablesChange?: (consumables: number[]) => void;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
timers?: boolean;
|
timers?: boolean;
|
||||||
hasHighEndConsumables?: boolean;
|
hasHighEndConsumables?: boolean;
|
||||||
hasConsumableDeliverySystem?: boolean;
|
hasConsumableDeliverySystem?: boolean;
|
||||||
cooldownBooster?: number;
|
cooldownBooster?: number;
|
||||||
}
|
};
|
||||||
|
|
||||||
export function ConsumablesManager({
|
export function ConsumablesManager({
|
||||||
consumables,
|
consumables,
|
||||||
selected,
|
selected,
|
||||||
onChange,
|
onConsumablesChange,
|
||||||
disabled,
|
disabled,
|
||||||
timers,
|
timers,
|
||||||
hasConsumableDeliverySystem,
|
hasConsumableDeliverySystem,
|
||||||
cooldownBooster,
|
cooldownBooster,
|
||||||
hasHighEndConsumables,
|
hasHighEndConsumables,
|
||||||
|
...props
|
||||||
}: ConsumablesManagerProps) {
|
}: ConsumablesManagerProps) {
|
||||||
return (
|
return (
|
||||||
<Flex wrap="wrap" gap="2">
|
<Flex wrap="wrap" gap="2" {...props}>
|
||||||
{consumables.map((consumable, index) => {
|
{consumables.map((consumable, index) => {
|
||||||
const isSelected = selected.some((id) => id === consumable.id);
|
const isSelected = selected.some((id) => id === consumable.id);
|
||||||
|
|
||||||
@@ -50,7 +51,7 @@ export function ConsumablesManager({
|
|||||||
consumable={consumable.id}
|
consumable={consumable.id}
|
||||||
selected={isSelected}
|
selected={isSelected}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (!onChange) return;
|
if (!onConsumablesChange) return;
|
||||||
|
|
||||||
const draft = [...selected];
|
const draft = [...selected];
|
||||||
|
|
||||||
@@ -60,7 +61,7 @@ export function ConsumablesManager({
|
|||||||
draft.push(consumable.id);
|
draft.push(consumable.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
onChange(draft);
|
onConsumablesChange(draft);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export function ConsumableButton({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<GenericTankComponentButton
|
<GenericTankComponentButton
|
||||||
|
style={{ width: '6rem' }}
|
||||||
tooltip={awaitedConsumableDefinitions[consumable].name}
|
tooltip={awaitedConsumableDefinitions[consumable].name}
|
||||||
icon={asset(`icons/consumables/${consumable}.webp`)}
|
icon={asset(`icons/consumables/${consumable}.webp`)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
Reference in new issue
Block a user