Merge pull request #2867 from SagePtr/corp-formula

Better readable production equation (rewording)
This commit is contained in:
hydroflame 2022-03-01 10:48:39 -05:00 committed by GitHub
commit 763800570b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -13,12 +13,12 @@ export function IndustryProductEquation(props: IProps): React.ReactElement {
if (reqAmt === undefined) continue; if (reqAmt === undefined) continue;
reqs.push(String.raw`${reqAmt}\text{ }${reqMat}`); reqs.push(String.raw`${reqAmt}\text{ }${reqMat}`);
} }
const prod = props.division.prodMats.slice(); const prod = props.division.prodMats.map((p) => `1\\text{ }${p}`);
if (props.division.makesProducts) { if (props.division.makesProducts) {
prod.push(props.division.type); prod.push("Products");
} }
return ( return (
<MathJaxWrapper>{"\\(" + reqs.join("+") + `\\Rightarrow` + prod.map((p) => `1 \\text{${p}}`).join("+") + "\\)"}</MathJaxWrapper> <MathJaxWrapper>{"\\(" + reqs.join("+") + `\\Rightarrow ` + prod.join("+") + "\\)"}</MathJaxWrapper>
); );
} }