mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 17:53:00 +02:00
20 lines
770 B
TypeScript
20 lines
770 B
TypeScript
import React from "react";
|
|
import { Player } from "../Player";
|
|
import { Exploit } from "./Exploit";
|
|
|
|
const getComputedStyle = window.getComputedStyle;
|
|
export function Unclickable(): React.ReactElement {
|
|
function unclickable(event: React.MouseEvent<HTMLDivElement>): void {
|
|
if (!event.target || !(event.target instanceof Element)) return;
|
|
const display = getComputedStyle(event.target).display;
|
|
const visibility = getComputedStyle(event.target).visibility;
|
|
if (display === "none" && visibility === "hidden" && event.isTrusted) Player.giveExploit(Exploit.Unclickable);
|
|
}
|
|
|
|
return (
|
|
<div id="unclickable" onClick={unclickable} style={{ display: "none", visibility: "hidden" }}>
|
|
Click on this to upgrade your Source-File -1!
|
|
</div>
|
|
);
|
|
}
|