-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Implement customizeable component for no data display - Added component to homepage Signed-off-by: Raul-Cristian Kele <[email protected]>
- Loading branch information
Showing
4 changed files
with
69 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,40 @@ | ||
// react global | ||
import React from 'react'; | ||
|
||
// components | ||
import { Stack, Typography } from '@mui/material'; | ||
|
||
//styling | ||
import makeStyles from '@mui/styles/makeStyles'; | ||
|
||
import nodataImage from '../../assets/noData.svg'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
noDataContainer: { | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center' | ||
}, | ||
noDataImage: { | ||
maxWidth: '233px', | ||
maxHeight: '240px' | ||
}, | ||
noDataText: { | ||
fontSize: '1.5rem', | ||
fontWeight: '600', | ||
color: theme.palette.secondary.main | ||
} | ||
})); | ||
|
||
function NoDataComponent({ text }) { | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<Stack className={classes.noDataContainer}> | ||
<img src={nodataImage} className={classes.noDataImage} /> | ||
<Typography className={classes.noDataText}>{text ? text : 'No Data'}</Typography> | ||
</Stack> | ||
); | ||
} | ||
|
||
export default NoDataComponent; |