mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: consumables
This commit is contained in:
1 parent
62bfab0960
commit
417385f231
14 files changed
+171
-152
No files matched your search
@@ -1,17 +0,0 @@
|
||||
import { asset } from '../../core/blitzkrieg/asset';
|
||||
import { GenericTankComponentButton } from './GenericTankComponentButton';
|
||||
import { TankComponentButtonProps } from './TankComponentButton';
|
||||
|
||||
export function CamouflageButton(props: TankComponentButtonProps) {
|
||||
return (
|
||||
<GenericTankComponentButton
|
||||
icon={asset('icons/camo.webp')}
|
||||
iconStyles={{
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
transform: 'translate(calc(-50% + 4px), calc(-50% + 4px))',
|
||||
}}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -28,6 +28,7 @@ export function GenericTankComponentButton({
|
||||
draggable={false}
|
||||
src={icon}
|
||||
style={{
|
||||
objectFit: 'contain',
|
||||
width: 32,
|
||||
height: 32,
|
||||
position: 'absolute',
|
||||
|
||||
@@ -10,6 +10,7 @@ export interface TankComponentButtonProps
|
||||
children?: ReactNode;
|
||||
discriminator?: ReactNode;
|
||||
disabled?: boolean;
|
||||
banner?: string;
|
||||
}
|
||||
|
||||
export function TankComponentButton({
|
||||
@@ -19,6 +20,7 @@ export function TankComponentButton({
|
||||
rowChild,
|
||||
discriminator,
|
||||
children,
|
||||
banner,
|
||||
...props
|
||||
}: TankComponentButtonProps) {
|
||||
return (
|
||||
@@ -36,9 +38,24 @@ export function TankComponentButton({
|
||||
borderBottomLeftRadius: first ? undefined : 0,
|
||||
borderBottomRightRadius: last ? undefined : 0,
|
||||
margin: rowChild ? -0.5 : 'unset',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
{...props}
|
||||
>
|
||||
{banner !== undefined && (
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
width: '200%',
|
||||
height: 12,
|
||||
backgroundColor: banner,
|
||||
top: '50%',
|
||||
left: '-50%',
|
||||
transform: 'translateY(-50%) rotate(-22.5deg)',
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{discriminator !== undefined && (
|
||||
<Text
|
||||
size="1"
|
||||
|
||||
Reference in new issue
Block a user