mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-28 07:04:10 +00:00
feat: update toast UI to match theme (#6622)
This commit is contained in:
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user