mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-25 23:47:34 +01:00
Move ProgressBar
component
This commit is contained in:
parent
9c805dabb8
commit
05078ffb08
@ -1,20 +1,8 @@
|
|||||||
import LinearProgress from "@mui/material/LinearProgress";
|
|
||||||
import React, { useState, useEffect } from "react";
|
|
||||||
import withStyles from "@mui/styles/withStyles";
|
|
||||||
import { Theme } from "@mui/material/styles";
|
|
||||||
import Grid from "@mui/material/Grid";
|
import Grid from "@mui/material/Grid";
|
||||||
import { use } from "../../ui/Context";
|
import React, { useEffect, useState } from "react";
|
||||||
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
|
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
|
||||||
|
import { use } from "../../ui/Context";
|
||||||
const TimerProgress = withStyles((theme: Theme) => ({
|
import { ProgressBar } from "../../ui/React/Progress";
|
||||||
root: {
|
|
||||||
backgroundColor: theme.palette.background.paper,
|
|
||||||
},
|
|
||||||
bar: {
|
|
||||||
transition: "none",
|
|
||||||
backgroundColor: theme.palette.primary.main,
|
|
||||||
},
|
|
||||||
}))(LinearProgress);
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
millis: number;
|
millis: number;
|
||||||
@ -44,7 +32,7 @@ export function GameTimer(props: IProps): React.ReactElement {
|
|||||||
// bar physically reaches the end
|
// bar physically reaches the end
|
||||||
return (
|
return (
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
<TimerProgress variant="determinate" value={v} color="primary" />
|
<ProgressBar variant="determinate" value={v} color="primary" />
|
||||||
</Grid>
|
</Grid>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
13
src/ui/React/Progress.tsx
Normal file
13
src/ui/React/Progress.tsx
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import LinearProgress from "@mui/material/LinearProgress";
|
||||||
|
import { Theme } from "@mui/material/styles";
|
||||||
|
import withStyles from "@mui/styles/withStyles";
|
||||||
|
|
||||||
|
export const ProgressBar = withStyles((theme: Theme) => ({
|
||||||
|
root: {
|
||||||
|
backgroundColor: theme.palette.background.paper,
|
||||||
|
},
|
||||||
|
bar: {
|
||||||
|
transition: "none",
|
||||||
|
backgroundColor: theme.palette.primary.main,
|
||||||
|
},
|
||||||
|
}))(LinearProgress);
|
Loading…
Reference in New Issue
Block a user