ConceptPortal-public/rsconcept/frontend/src/app/ConceptToaster.tsx

14 lines
421 B
TypeScript
Raw Normal View History

2023-07-25 20:27:29 +03:00
import { ToastContainer, type ToastContainerProps } from 'react-toastify';
2024-04-01 19:07:20 +03:00
import { useConceptOptions } from '@/context/OptionsContext';
2023-12-28 14:04:44 +03:00
interface ToasterThemedProps extends Omit<ToastContainerProps, 'theme'> {}
function ToasterThemed(props: ToasterThemedProps) {
2024-04-01 19:07:20 +03:00
const { darkMode } = useConceptOptions();
2023-07-25 20:27:29 +03:00
2023-12-28 14:04:44 +03:00
return <ToastContainer theme={darkMode ? 'dark' : 'light'} {...props} />;
}
2023-12-28 14:04:44 +03:00
export default ToasterThemed;