fix issue with corp export popup

This commit is contained in:
Olivier Gagnon 2021-10-11 22:48:34 -04:00
parent b1e37acaa1
commit 1d4cf45a92
3 changed files with 26 additions and 9 deletions

@ -80,10 +80,20 @@ export function ExpandIndustryTab(props: IProps): React.ReactElement {
<Typography>Division name:</Typography>
<Box display="flex" alignItems="center">
<TextField autoFocus={true} value={name} onChange={onNameChange} onKeyDown={onKeyDown} type="text" />
<Button disabled={disabled} sx={{ mx: 1 }} onClick={newIndustry}>
Create Division
</Button>
<TextField
autoFocus={true}
value={name}
onChange={onNameChange}
onKeyDown={onKeyDown}
type="text"
InputProps={{
endAdornment: (
<Button disabled={disabled} sx={{ mx: 1 }} onClick={newIndustry}>
Expand
</Button>
),
}}
/>
</Box>
</>
);

@ -43,16 +43,21 @@ export function ExpandNewCity(props: IProps): React.ReactElement {
Would you like to expand into a new city by opening an office? This would cost{" "}
<MoneyCost money={CorporationConstants.OfficeInitialCost} corp={corp} />
</Typography>
<Select value={city} onChange={onCityChange}>
<Select
endAdornment={
<Button onClick={expand} disabled={disabled}>
Confirm
</Button>
}
value={city}
onChange={onCityChange}
>
{possibleCities.map((cityName: string) => (
<MenuItem key={cityName} value={cityName}>
{cityName}
</MenuItem>
))}
</Select>
<Button onClick={expand} disabled={disabled}>
Confirm
</Button>
</>
);
}

@ -39,7 +39,9 @@ export function ExportModal(props: IProps): React.ReactElement {
}
function onIndustryChange(event: SelectChangeEvent<string>): void {
setIndustry(event.target.value);
const div = event.target.value;
setIndustry(div);
setCity(Object.keys(corp.divisions[0].warehouses)[0]);
}
function onAmtChange(event: React.ChangeEvent<HTMLInputElement>): void {