make tutorial better

This commit is contained in:
Olivier Gagnon
2021-12-16 20:53:44 -05:00
parent 81e291ef6a
commit ae6f8c5ee7
7 changed files with 57 additions and 29 deletions

View File

@@ -1,20 +1,28 @@
import React from "react";
import React, { useState } from "react";
import Typography from "@mui/material/Typography";
import Link from "@mui/material/Link";
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
import { ConfirmationModal } from "../../ui/React/ConfirmationModal";
interface IProps {
reactivateTutorial: () => void;
}
export function TutorialRoot(props: IProps): React.ReactElement {
const [confirmResetOpen, setConfirmResetOpen] = useState(false);
return (
<>
<Typography variant="h4">Tutorial / Documentation</Typography>
<Box m={2}>
<Button onClick={props.reactivateTutorial}>Soft reset and Restart tutorial</Button>
<Button onClick={() => setConfirmResetOpen(true)}>Soft reset and Restart tutorial</Button>
<ConfirmationModal
open={confirmResetOpen}
onClose={() => setConfirmResetOpen(false)}
onConfirm={props.reactivateTutorial}
confirmationText={"This will reset all your stats to 1 and money to 1k. Are you sure?"}
/>
<Link
color="primary"
target="_blank"
@@ -94,6 +102,14 @@ export function TutorialRoot(props: IProps): React.ReactElement {
<Link color="primary" target="_blank" href="https://bitburner.readthedocs.io/en/latest/shortcuts.html">
<Typography>Keyboard Shortcuts</Typography>
</Link>
<br />
<Link
color="primary"
target="_blank"
href="https://bitburner.readthedocs.io/en/latest/netscript/netscriptlearntoprogram.html#netscript-1-0-vs-netscript-2-0"
>
<Typography>NS1 vs NS1 (or .script vs .js)</Typography>
</Link>
</Box>
</>
);