From 94ad7ccf4bec15c7bd27a11339273374225ca30c Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Sat, 28 Aug 2021 02:57:57 -0400 Subject: [PATCH] more conversion --- ...ustryOverview.jsx => IndustryOverview.tsx} | 84 ++++++++++--------- src/Corporation/ui/IndustryWarehouse.tsx | 2 +- 2 files changed, 45 insertions(+), 41 deletions(-) rename src/Corporation/ui/{IndustryOverview.jsx => IndustryOverview.tsx} (85%) diff --git a/src/Corporation/ui/IndustryOverview.jsx b/src/Corporation/ui/IndustryOverview.tsx similarity index 85% rename from src/Corporation/ui/IndustryOverview.jsx rename to src/Corporation/ui/IndustryOverview.tsx index a3e1e2b5b..2cc4d2b62 100644 --- a/src/Corporation/ui/IndustryOverview.jsx +++ b/src/Corporation/ui/IndustryOverview.tsx @@ -1,7 +1,6 @@ // React Component for displaying an Industry's overview information // (top-left panel in the Industry UI) import React from "react"; -import { BaseReactComponent } from "./BaseReactComponent"; import { OfficeSpace } from "../OfficeSpace"; import { Industries } from "../IndustryData"; @@ -10,11 +9,19 @@ import { numeralWrapper } from "../../ui/numeralFormat"; import { dialogBoxCreate } from "../../../utils/DialogBox"; import { createProgressBarText } from "../../../utils/helpers/createProgressBarText"; -export class IndustryOverview extends BaseReactComponent { - renderMakeProductButton() { - const division = this.routing().currentDivision; // Validated inside render() +interface IProps { + routing: any; + eventHandler: any; + corp: any; + currentCity: string; +} - var createProductButtonText, createProductPopupText; +export function IndustryOverview(props: IProps): React.ReactElement { + function renderMakeProductButton() { + const division = props.routing.currentDivision; // Validated inside render() + + let createProductButtonText = ""; + let createProductPopupText = ""; switch(division.type) { case Industries.Food: createProductButtonText = "Build Restaurant"; @@ -65,14 +72,13 @@ export class IndustryOverview extends BaseReactComponent { const hasMaxProducts = division.hasMaximumNumberProducts(); const className = hasMaxProducts ? "a-link-button-inactive tooltip" : "std-button"; - const onClick = this.eventHandler().createMakeProductPopup.bind(this.eventHandler(), createProductPopupText, division); const buttonStyle = { margin: "6px", display: "inline-block", } return ( -