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 ( -