diff --git a/src/Corporation/ui/modals/SellSharesModal.tsx b/src/Corporation/ui/modals/SellSharesModal.tsx index fa2a05774..688fb119b 100644 --- a/src/Corporation/ui/modals/SellSharesModal.tsx +++ b/src/Corporation/ui/modals/SellSharesModal.tsx @@ -33,21 +33,22 @@ export function SellSharesModal(props: IProps): React.ReactElement { function ProfitIndicator(props: { shares: number | null; corp: ICorporation }): React.ReactElement { if (props.shares === null) return <>; + let text = ""; if (isNaN(props.shares) || props.shares <= 0) { - return ERROR: Invalid value entered for number of shares to sell ; + text = `ERROR: Invalid value entered for number of shares to sell`; } else if (props.shares > corp.numShares) { - return You don't have this many shares to sell! ; + text = `You don't have this many shares to sell!`; } else { const stockSaleResults = corp.calculateShareSale(props.shares); const profit = stockSaleResults[0]; - return ( - - - Sell {props.shares} shares for a total of {numeralWrapper.formatMoney(profit)} - - - ); + text = `Sell ${props.shares} shares for a total of ${numeralWrapper.formatMoney(profit)}`; } + + return ( + + {text} + + ); } function sell(): void { @@ -86,7 +87,6 @@ export function SellSharesModal(props: IProps): React.ReactElement {
The current price of your company's stock is {numeralWrapper.formatMoney(corp.sharePrice)} -
Sell shares + ); }