-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Cleanup & fixes * fix linting errors & add banner * final touches
- Loading branch information
Showing
10 changed files
with
150 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import CloseIcon from '@mui/icons-material/Close'; | ||
import { Alert, IconButton } from '@mui/material'; | ||
import React, { useState } from 'react'; | ||
|
||
interface BannerProps { | ||
content: string; | ||
severity: 'info' | 'error' | 'warning' | 'success'; | ||
} | ||
|
||
const Banner = ({ content, severity }: BannerProps) => { | ||
const [open, setOpen] = useState(true); | ||
|
||
const handleClose = () => { | ||
setOpen(false); | ||
}; | ||
|
||
if (!open) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Alert | ||
severity={severity} | ||
action={ | ||
<IconButton | ||
aria-label='close' | ||
color='inherit' | ||
size='small' | ||
onClick={handleClose} | ||
> | ||
<CloseIcon fontSize='inherit' /> | ||
</IconButton> | ||
} | ||
> | ||
{content} | ||
</Alert> | ||
); | ||
}; | ||
|
||
export default Banner; |
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
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
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