-
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.
feat: adding loading message for fetches
- Loading branch information
1 parent
005823a
commit 2917cc6
Showing
4 changed files
with
43 additions
and
4 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
18 changes: 18 additions & 0 deletions
18
client/src/components/main/shared/LoadingMessage/LoadingMessage.tsx
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,18 @@ | ||
import { Box, CircularProgress, makeStyles } from "@material-ui/core"; | ||
import React from "react"; | ||
|
||
interface LoadingMessageProps { | ||
message?: string; | ||
} | ||
|
||
export default function StrandSwitch( | ||
props: LoadingMessageProps | ||
): React.ReactElement { | ||
const loadingMessage = props?.message ? props.message : "Loading..." | ||
return ( | ||
<Box alignContent="center" alignItems="center" justifyContent="center" display="flex" flexDirection="column"> | ||
<Box mb={2}>{loadingMessage}</Box> | ||
<CircularProgress /> | ||
</Box> | ||
); | ||
} |
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