From 0a210555e917b53adc021591f072e1125b8d289c Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Thu, 9 Sep 2021 13:00:06 -0400 Subject: [PATCH] remove some createElement --- src/Corporation/ui/IssueNewSharesPopup.tsx | 12 ------- src/Corporation/ui/ResearchPopup.tsx | 38 ++++++++-------------- src/Infiltration/Helper.tsx | 2 +- 3 files changed, 15 insertions(+), 37 deletions(-) diff --git a/src/Corporation/ui/IssueNewSharesPopup.tsx b/src/Corporation/ui/IssueNewSharesPopup.tsx index 96f92f9ba..8ecf7abe0 100644 --- a/src/Corporation/ui/IssueNewSharesPopup.tsx +++ b/src/Corporation/ui/IssueNewSharesPopup.tsx @@ -137,16 +137,4 @@ export function IssueNewSharesPopup(props: IProps): React.ReactElement { ); - - // let issueBtn, newSharesInput; - // const dynamicText = createElement("p", { - // display: "block", - // }); - - // function updateDynamicText(corp) { - - // } - - // createPopup(popupId, [descText, dynamicText, newSharesInput, issueBtn, cancelBtn]); - // newSharesInput.focus(); } diff --git a/src/Corporation/ui/ResearchPopup.tsx b/src/Corporation/ui/ResearchPopup.tsx index 4660dcf25..38d5323e0 100644 --- a/src/Corporation/ui/ResearchPopup.tsx +++ b/src/Corporation/ui/ResearchPopup.tsx @@ -15,6 +15,8 @@ interface IProps { // Create the Research Tree UI for this Industry export function ResearchPopup(props: IProps): React.ReactElement { + const researchTree = IndustryResearchTrees[props.industry.type]; + if (researchTree === undefined) return <>; useEffect(() => { { const boxContent = document.getElementById(`${props.popupId}-content`); @@ -22,8 +24,6 @@ export function ResearchPopup(props: IProps): React.ReactElement { boxContent.style.minHeight = "80vh"; } } - const researchTree = IndustryResearchTrees[props.industry.type]; - if (researchTree === undefined) return; // Get the tree's markup (i.e. config) for Treant const markup = researchTree.createTreantMarkup(); @@ -80,33 +80,23 @@ export function ResearchPopup(props: IProps): React.ReactElement { } }); } - - const boxContent = document.getElementById(`${props.popupId}-content`); - if (boxContent != null) { - // Add information about multipliers from research at the bottom of the popup - //appendLineBreaks(boxContent, 2); - boxContent.appendChild( - createElement("pre", { - display: "block", - innerText: - `Multipliers from research:\n` + - ` * Advertising Multiplier: x${researchTree.getAdvertisingMultiplier()}\n` + - ` * Employee Charisma Multiplier: x${researchTree.getEmployeeChaMultiplier()}\n` + - ` * Employee Creativity Multiplier: x${researchTree.getEmployeeCreMultiplier()}\n` + - ` * Employee Efficiency Multiplier: x${researchTree.getEmployeeEffMultiplier()}\n` + - ` * Employee Intelligence Multiplier: x${researchTree.getEmployeeIntMultiplier()}\n` + - ` * Production Multiplier: x${researchTree.getProductionMultiplier()}\n` + - ` * Sales Multiplier: x${researchTree.getSalesMultiplier()}\n` + - ` * Scientific Research Multiplier: x${researchTree.getScientificResearchMultiplier()}\n` + - ` * Storage Multiplier: x${researchTree.getStorageMultiplier()}`, - }), - ); - } }); return (
+
+ Multipliers from research: +
* Advertising Multiplier: x{researchTree.getAdvertisingMultiplier()} +
* Employee Charisma Multiplier: x{researchTree.getEmployeeChaMultiplier()} +
* Employee Creativity Multiplier: x{researchTree.getEmployeeCreMultiplier()} +
* Employee Efficiency Multiplier: x{researchTree.getEmployeeEffMultiplier()} +
* Employee Intelligence Multiplier: x{researchTree.getEmployeeIntMultiplier()} +
* Production Multiplier: x{researchTree.getProductionMultiplier()} +
* Sales Multiplier: x{researchTree.getSalesMultiplier()} +
* Scientific Research Multiplier: x{researchTree.getScientificResearchMultiplier()} +
* Storage Multiplier: x{researchTree.getStorageMultiplier()} +
); } diff --git a/src/Infiltration/Helper.tsx b/src/Infiltration/Helper.tsx index 9269ecb01..a15fae91e 100644 --- a/src/Infiltration/Helper.tsx +++ b/src/Infiltration/Helper.tsx @@ -5,7 +5,7 @@ import { IEngine } from "../IEngine"; import * as React from "react"; import * as ReactDOM from "react-dom"; -let container: HTMLElement = document.createElement("div"); +let container: HTMLElement; (function () { function setContainer(): void {