ConceptPortal-public/rsconcept/frontend/src/components/ToasterThemed.tsx

16 lines
381 B
TypeScript
Raw Normal View History

2023-07-25 20:27:29 +03:00
import { ToastContainer, type ToastContainerProps } from 'react-toastify';
import { useConceptTheme } from '../context/ThemeContext';
2023-07-25 20:27:29 +03:00
function ToasterThemed({ theme, ...props }: ToastContainerProps) {
const { darkMode } = useConceptTheme();
2023-07-25 20:27:29 +03:00
return (
2023-07-25 20:27:29 +03:00
<ToastContainer
theme={ darkMode ? 'dark' : 'light'}
{...props}
/>
);
}
2023-07-25 20:27:29 +03:00
export default ToasterThemed;