mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-05 07:07:50 +02:00
more cleanup in engine
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import { Page, routing } from ".././ui/navigationTracking";
|
||||
import { Root } from "./ui/Root";
|
||||
import { Player } from "../Player";
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
|
||||
let milestonesContainer: HTMLElement | null = null;
|
||||
|
||||
(function () {
|
||||
function setContainer(): void {
|
||||
milestonesContainer = document.getElementById("milestones-container");
|
||||
document.removeEventListener("DOMContentLoaded", setContainer);
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", setContainer);
|
||||
})();
|
||||
|
||||
export function displayMilestonesContent(): void {
|
||||
if (!routing.isOn(Page.Milestones)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (milestonesContainer instanceof HTMLElement) {
|
||||
ReactDOM.render(<Root player={Player} />, milestonesContainer);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ function highestMilestone(p: IPlayer, milestones: Milestone[]): number {
|
||||
return n;
|
||||
}
|
||||
|
||||
export function Root(props: IProps): JSX.Element {
|
||||
export function MilestonesRoot(props: IProps): JSX.Element {
|
||||
const n = highestMilestone(props.player, Milestones);
|
||||
const milestones = Milestones.map((milestone: Milestone, i: number) => {
|
||||
if (i <= n + 1) {
|
||||
Reference in New Issue
Block a user