Move ProgressBar component

This commit is contained in:
nickofolas 2022-05-02 15:36:21 -05:00
parent 9c805dabb8
commit 05078ffb08
2 changed files with 17 additions and 16 deletions

@ -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

@ -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);