feat: update toast UI to match theme (#6622)

This commit is contained in:
gopu-bruno
2026-01-02 15:05:34 +05:30
committed by GitHub
parent 156e798f90
commit c03c5eb927

View File

@@ -6,25 +6,21 @@ import { isPlaywright } from 'utils/common';
export const ToastContext = React.createContext();
export const ToastProvider = (props) => {
const { storedTheme } = useTheme();
const { theme, displayedTheme } = useTheme();
const toastOptions = {
duration: isPlaywright() ? 500 : 2000,
style: {
// Break long word like file-path, URL etc. to prevent overflow
overflowWrap: 'anywhere'
overflowWrap: 'anywhere',
borderRadius: theme.border.radius.lg,
background: displayedTheme === 'light'
? theme.background.base
: theme.background.crust,
color: theme.text
}
};
if (storedTheme === 'dark') {
toastOptions.style = {
...toastOptions.style,
borderRadius: '10px',
background: '#3d3d3d',
color: '#fff'
};
}
return (
<ToastContext.Provider {...props} value="toastProvider">
<Toaster toastOptions={toastOptions} />