diff --git a/src/Corporation/ui/IndustryProductEquation.tsx b/src/Corporation/ui/IndustryProductEquation.tsx index b738cbc75..9ad32d4ae 100644 --- a/src/Corporation/ui/IndustryProductEquation.tsx +++ b/src/Corporation/ui/IndustryProductEquation.tsx @@ -1,6 +1,6 @@ import React from "react"; import { IIndustry } from "../IIndustry"; -import { MathJax, MathJaxContext } from "better-react-mathjax"; +import { MathJaxWrapper } from "../../MathJaxWrapper"; interface IProps { division: IIndustry; @@ -19,8 +19,6 @@ export function IndustryProductEquation(props: IProps): React.ReactElement { } return ( - - {"\\(" + reqs.join("+") + `\\Rightarrow` + prod.map((p) => `1 \\text{${p}}`).join("+") + "\\)"} - + {"\\(" + reqs.join("+") + `\\Rightarrow` + prod.map((p) => `1 \\text{${p}}`).join("+") + "\\)"} ); } diff --git a/src/Faction/ui/DonateOption.tsx b/src/Faction/ui/DonateOption.tsx index e22f5b68a..c189e3ce1 100644 --- a/src/Faction/ui/DonateOption.tsx +++ b/src/Faction/ui/DonateOption.tsx @@ -15,7 +15,7 @@ import { Reputation } from "../../ui/React/Reputation"; import { numeralWrapper } from "../../ui/numeralFormat"; import { dialogBoxCreate } from "../../ui/React/DialogBox"; -import { MathJax, MathJaxContext } from "better-react-mathjax"; +import { MathJaxWrapper } from "../../MathJaxWrapper"; import Typography from "@mui/material/Typography"; import Paper from "@mui/material/Paper"; @@ -98,9 +98,7 @@ export function DonateOption(props: IProps): React.ReactElement { }} /> - - {`\\(reputation = \\frac{\\text{donation amount} \\cdot \\text{reputation multiplier}}{10^{${digits}}}\\)`} - + {`\\(reputation = \\frac{\\text{donation amount} \\cdot \\text{reputation multiplier}}{10^{${digits}}}\\)`} )} diff --git a/src/Faction/ui/Info.tsx b/src/Faction/ui/Info.tsx index 55f403cbe..39992846f 100644 --- a/src/Faction/ui/Info.tsx +++ b/src/Faction/ui/Info.tsx @@ -9,7 +9,7 @@ import { FactionInfo } from "../../Faction/FactionInfo"; import { Reputation } from "../../ui/React/Reputation"; import { Favor } from "../../ui/React/Favor"; -import { MathJax, MathJaxContext } from "better-react-mathjax"; +import { MathJaxWrapper } from "../../MathJaxWrapper"; import makeStyles from "@mui/styles/makeStyles"; import createStyles from "@mui/styles/createStyles"; @@ -57,16 +57,12 @@ export function Info(props: IProps): React.ReactElement { You will have faction favor after installing an Augmentation. - - {"\\(\\huge{r = \\text{total faction reputation}}\\)"} - - - - { - "\\(\\huge{favor=1+\\left\\lfloor\\log_{1.02}\\left(\\frac{r+25000}{25500}\\right)\\right\\rfloor}\\)" - } - - + {"\\(\\huge{r = \\text{total faction reputation}}\\)"} + + { + "\\(\\huge{favor=1+\\left\\lfloor\\log_{1.02}\\left(\\frac{r+25000}{25500}\\right)\\right\\rfloor}\\)" + } + } > @@ -88,12 +84,9 @@ export function Info(props: IProps): React.ReactElement { amount of reputation you earned with this faction. Across all resets. - - {"\\(\\huge{r = reputation}\\)"} - - - {"\\(\\huge{\\Delta r = \\Delta r \\times \\frac{100+favor}{100}}\\)"} - + {"\\(\\huge{r = reputation}\\)"} + {"\\(\\huge{\\Delta r = \\Delta r \\times \\frac{100+favor}{100}}\\)"} + } > diff --git a/src/Locations/ui/CoresButton.tsx b/src/Locations/ui/CoresButton.tsx index 2a60a34b6..b4b0771ad 100644 --- a/src/Locations/ui/CoresButton.tsx +++ b/src/Locations/ui/CoresButton.tsx @@ -6,7 +6,7 @@ import Typography from "@mui/material/Typography"; import { IPlayer } from "../../PersonObjects/IPlayer"; import { Money } from "../../ui/React/Money"; -import { MathJax, MathJaxContext } from "better-react-mathjax"; +import { MathJaxWrapper } from "../../MathJaxWrapper"; type IProps = { p: IPlayer; @@ -33,9 +33,7 @@ export function CoresButton(props: IProps): React.ReactElement { return ( - {`\\(\\large{cost = 10^9 \\cdot 7.5 ^{\\text{cores}}}\\)`} - + {`\\(\\large{cost = 10^9 \\cdot 7.5 ^{\\text{cores}}}\\)`} } > diff --git a/src/Locations/ui/RamButton.tsx b/src/Locations/ui/RamButton.tsx index 5df8a7544..a8c3d146b 100644 --- a/src/Locations/ui/RamButton.tsx +++ b/src/Locations/ui/RamButton.tsx @@ -9,7 +9,8 @@ import { purchaseRamForHomeComputer } from "../../Server/ServerPurchases"; import { Money } from "../../ui/React/Money"; import { numeralWrapper } from "../../ui/numeralFormat"; -import { MathJax, MathJaxContext } from "better-react-mathjax"; + +import { MathJaxWrapper } from "../../MathJaxWrapper"; type IProps = { p: IPlayer; @@ -32,9 +33,7 @@ export function RamButton(props: IProps): React.ReactElement { return ( - {`\\(\\large{cost = 3.2 \\cdot 10^3 \\cdot 1.58^{log_2{(ram)}}}\\)`} - + {`\\(\\large{cost = 3.2 \\cdot 10^3 \\cdot 1.58^{log_2{(ram)}}}\\)`} } > diff --git a/src/MathJaxWrapper.tsx b/src/MathJaxWrapper.tsx new file mode 100644 index 000000000..7525ea152 --- /dev/null +++ b/src/MathJaxWrapper.tsx @@ -0,0 +1,14 @@ +import React from 'react'; +import { MathJax, MathJaxContext } from "better-react-mathjax"; + +interface IProps { + children: React.ReactNode; +} + +export function MathJaxWrapper({ children }: IProps): React.ReactElement { + return ( + + {children} + + ) +}