mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-04 22:59:42 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
@@ -1,26 +1,28 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import Grid from '@material-ui/core/Grid';
|
||||
import React, { useState, useEffect } from "react";
|
||||
import Grid from "@material-ui/core/Grid";
|
||||
|
||||
interface IProps {
|
||||
onFinish: () => void;
|
||||
onFinish: () => void;
|
||||
}
|
||||
|
||||
export function Countdown(props: IProps): React.ReactElement {
|
||||
const [x, setX] = useState(3);
|
||||
useEffect(() => {
|
||||
if(x === 0) {
|
||||
props.onFinish();
|
||||
return;
|
||||
}
|
||||
setTimeout(()=>setX(x-1), 200);
|
||||
});
|
||||
const [x, setX] = useState(3);
|
||||
useEffect(() => {
|
||||
if (x === 0) {
|
||||
props.onFinish();
|
||||
return;
|
||||
}
|
||||
setTimeout(() => setX(x - 1), 200);
|
||||
});
|
||||
|
||||
return (<>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<h1>Get Ready!</h1>
|
||||
<h1>{x}</h1>
|
||||
</Grid>
|
||||
return (
|
||||
<>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<h1>Get Ready!</h1>
|
||||
<h1>{x}</h1>
|
||||
</Grid>
|
||||
</>)
|
||||
}
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user