-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f50949b
commit c1ba4c3
Showing
5 changed files
with
79 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { Box, Typography } from "@material-ui/core"; | ||
import { FC, useEffect} from "react"; | ||
import { IQuitProps } from "./quit.types"; | ||
import LoadingIndicator from '../../atoms/LoadingIndicator/LoadingIndicator'; | ||
import QuitService from '../../../services/quitService/quitService'; | ||
import useSnackbar from '../../molecules/Snackbar/useSnackbar.hook'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
const Quit: FC<IQuitProps> = () => { | ||
const { openSnackbar } = useSnackbar(); | ||
const navigate = useNavigate(); | ||
|
||
useEffect(()=>{ | ||
const sendQuitSignal = async () => { | ||
await QuitService.sendQuitSignal(); | ||
}; | ||
|
||
sendQuitSignal() | ||
.then(() => { | ||
navigate('/setup'); | ||
}) | ||
.catch((e) => { | ||
openSnackbar('Unable to gracefully quit', 'error'); | ||
}); | ||
},[]) | ||
|
||
return <Box mt={4} | ||
flexDirection={"column"} | ||
display={'flex'} | ||
justifyContent="center" | ||
alignItems="center" | ||
minHeight="100vh" | ||
marginTop={"-130px"} | ||
> | ||
|
||
<Box | ||
mt={2} | ||
display={'flex'} | ||
alignItems={'center'} | ||
justifyContent={'center'} | ||
flexDirection={"column"} | ||
> | ||
<LoadingIndicator /> | ||
<br></br> | ||
<Typography>Cleaning up environment...</Typography> | ||
</Box> | ||
</Box> | ||
|
||
|
||
} | ||
|
||
export default Quit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export interface IQuitProps{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters