mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-10-23 18:23:15 +02:00
26432082e2
This adds a new page reachable from the import save file options menu. It shows the difference between the current save and the data that is being imported, for confirmation. Includes an "automatic" variant, which has different wording for when Electron decides it has access to a newer version of the game. While in this screen, the autosave is disabled. This also adds a new BypassWrapper component around the game's tree. It allows for content to be displayed without rendering the nested pages (import, recovery). This prevents player scripts from messing with the screen.
32 lines
759 B
TypeScript
32 lines
759 B
TypeScript
import React from "react";
|
|
import { Modal } from "./Modal";
|
|
|
|
import Button from "@mui/material/Button";
|
|
import Typography from "@mui/material/Typography";
|
|
|
|
interface IProps {
|
|
open: boolean;
|
|
onClose: () => void;
|
|
onConfirm: () => void;
|
|
confirmationText: string | React.ReactNode;
|
|
additionalButton?: React.ReactNode;
|
|
}
|
|
|
|
export function ConfirmationModal(props: IProps): React.ReactElement {
|
|
return (
|
|
<Modal open={props.open} onClose={props.onClose}>
|
|
<>
|
|
<Typography>{props.confirmationText}</Typography>
|
|
<Button
|
|
onClick={() => {
|
|
props.onConfirm();
|
|
}}
|
|
>
|
|
Confirm
|
|
</Button>
|
|
{props.additionalButton && <>{props.additionalButton}</>}
|
|
</>
|
|
</Modal>
|
|
);
|
|
}
|