mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
fix: notification from useApp should consume App config (#49339)
* feat: notfication use global showProgress, pauseOnHover config * fix: notification not inherit app config
This commit is contained in:
parent
50a5bf6681
commit
bcd667068e
@ -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…
Reference in New Issue
Block a user