feat: snackbar ui

This commit is contained in:
amhsirak
2024-12-09 01:16:07 +05:30
parent 612622725d
commit dad4a4a927

View File

@@ -99,24 +99,23 @@ export const NavBar: React.FC<NavBarProps> = ({ recordingName, isRecording }) =>
{isUpdateAvailable && ( {isUpdateAvailable && (
<Snackbar <Snackbar
open={isUpdateAvailable} open={isUpdateAvailable}
onClose={() => setIsUpdateAvailable(false)} // Close when clicking the close button onClose={() => setIsUpdateAvailable(false)}
message={ message={
<span style={{ color: 'black' }}> `New version ${latestVersion} available! Click "Upgrade" to update.`
New version {latestVersion} available! Click "Upgrade Maxun" to update.
</span>
} }
action={ action={
<> <>
<Button <Button
color="primary" color="primary"
size="small" size="small"
onClick={handleUpdateOpen} // Open the upgrade modal onClick={handleUpdateOpen}
style={{ style={{
backgroundColor: '#ff00c3', backgroundColor: '#ff00c3',
color: 'white', color: 'white',
fontWeight: 'bold', fontWeight: 'bold',
textTransform: 'none', textTransform: 'none',
marginRight: '8px', marginRight: '8px',
borderRadius: '5px',
}} }}
> >
Upgrade Upgrade
@@ -125,17 +124,18 @@ export const NavBar: React.FC<NavBarProps> = ({ recordingName, isRecording }) =>
size="small" size="small"
aria-label="close" aria-label="close"
color="inherit" color="inherit"
onClick={() => setIsUpdateAvailable(false)} // Close Snackbar onClick={() => setIsUpdateAvailable(false)}
style={{ color: 'black' }} style={{ color: 'black' }}
> >
<Close /> <Close />
</IconButton> </IconButton>
</> </>
} }
anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }} // Position of Snackbar ContentProps={{
sx={{ sx: {
backgroundColor: 'white', background: "white",
boxShadow: '0px 4px 10px rgba(0, 0, 0, 0.2)', color: "black",
}
}} }}
/> />