fix: notification from useApp should consume App config (#49339)

* feat: notfication use global showProgress, pauseOnHover config

* fix: notification not inherit app config
pull/49345/head
Minko 8 months ago committed by GitHub
parent 50a5bf6681
commit bcd667068e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -34,10 +34,10 @@ let taskQueue: Task[] = [];
let defaultGlobalConfig: GlobalConfigProps = {};
function getGlobalContext() {
const { getContainer, rtl, maxCount, top, bottom } = defaultGlobalConfig;
const { getContainer, rtl, maxCount, top, bottom, showProgress, pauseOnHover } = defaultGlobalConfig;
const mergedContainer = getContainer?.() || document.body;
return { getContainer: () => mergedContainer, rtl, maxCount, top, bottom };
return { getContainer: () => mergedContainer, rtl, maxCount, top, bottom, showProgress, pauseOnHover };
}
interface GlobalHolderRef {

@ -65,6 +65,8 @@ const Holder = React.forwardRef<HolderRef, HolderProps>((props, ref) => {
onAllRemoved,
stack,
duration,
pauseOnHover = true,
showProgress,
} = props;
const { getPrefixCls, getPopupContainer, notification, direction } = useContext(ConfigContext);
const [, token] = useToken();
@ -89,9 +91,10 @@ const Holder = React.forwardRef<HolderRef, HolderProps>((props, ref) => {
closable: true,
closeIcon: getCloseIcon(prefixCls),
duration: duration ?? DEFAULT_DURATION,
pauseOnHover: true,
getContainer: () => staticGetContainer?.() || getPopupContainer?.() || document.body,
maxCount,
pauseOnHover,
showProgress,
onAllRemoved,
renderNotifications,
stack:

Loading…
Cancel
Save