1
0
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:
Hubert Walczak
2023-11-02 12:11:03 +01:00
parent 44f173f23c
commit f88baa5fc9
90 changed files with 7411 additions and 2706 deletions
+13 -15
View File
@@ -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;