mirror of
https://github.com/lexogrine/cs2-react-hud.git
synced 2026-05-04 04:03:10 +02:00
Updated setup to vite and moved to hooks instead of class
This commit is contained in:
+13
-15
@@ -1,15 +1,13 @@
|
||||
import React from 'react';
|
||||
import { Player } from 'csgogsi-socket';
|
||||
import {Bomb as BombIcon} from './../../assets/Icons';
|
||||
export default class Bomb extends React.Component<{ player: Player }> {
|
||||
render() {
|
||||
const { player } = this.props;
|
||||
if(Object.values(player.weapons).every(weapon => weapon.type !== "C4")) return '';
|
||||
return (
|
||||
<div className={`armor_indicator`}>
|
||||
<BombIcon />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
import { Player } from "csgogsi";
|
||||
import { Bomb as BombIcon } from "./../../assets/Icons";
|
||||
const Bomb = ({ player }: { player: Player }) => {
|
||||
if (Object.values(player.weapons).every((weapon) => weapon.type !== "C4")) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<div className={`armor_indicator`}>
|
||||
<BombIcon />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default Bomb;
|
||||
|
||||
Reference in New Issue
Block a user