All Downloads are FREE. Search and download functionalities are using the official Maven repository.

contexts.NotificationContext.js Maven / Gradle / Ivy

There is a newer version: 0.80.3
Show newest version
import React                    from 'react';
import { createContext }  			from 'react';
import { SnackbarProvider } 		from 'notistack';
import { Collapse, IconButton } from '@mui/material';
import { Close as CloseIcon }		from '@mui/icons-material';

export const NotificationContext = createContext();

const NotificationProvider = ({children, ...props}) => {
  const notistackRef = React.createRef();
  
  const onClickDismiss = key => () => { 
    notistackRef.current.closeSnackbar(key);
  }
	
  return (
    
       (
           
            
          
				)}
        sx={{
          "& .SnackbarItem-action": {
            "& .MuiButtonBase-root": {
              color: "#ffffff"
            }
          }
        }}
			>
				{children}
			
    
  );
}

export default NotificationProvider;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy