mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: code split module buttons
This commit is contained in:
1 parent
9d7c60e92d
commit
574b1eec92
17 files changed
+230
-153
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { HTMLAttributes } from 'react';
|
||||
import {
|
||||
TankComponentButton,
|
||||
TankComponentButtonProps,
|
||||
} from './TankComponentButton';
|
||||
|
||||
interface GenericTankComponentButtonProps extends TankComponentButtonProps {
|
||||
icon: string;
|
||||
iconStyles?: HTMLAttributes<HTMLImageElement>['style'];
|
||||
}
|
||||
|
||||
export function GenericTankComponentButton({
|
||||
icon,
|
||||
iconStyles,
|
||||
...props
|
||||
}: GenericTankComponentButtonProps) {
|
||||
return (
|
||||
<TankComponentButton disabled={props.disabled} {...props}>
|
||||
<img
|
||||
draggable={false}
|
||||
src={icon}
|
||||
style={{
|
||||
width: 32,
|
||||
height: 32,
|
||||
position: 'absolute',
|
||||
opacity: props.disabled ? 0.5 : 1,
|
||||
transform: 'scale(0.75)',
|
||||
...iconStyles,
|
||||
}}
|
||||
/>
|
||||
</TankComponentButton>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user