type: Add placement to NotificationConfig (#40908)

* Add placement to NotificationConfig

* Update useNotification.tsx

---------

Co-authored-by: Martijn Dormans <martijn.dormans@whyellow.nl>
Co-authored-by: Wuxh <wxh16144@qq.com>
This commit is contained in:
Martijn 2023-02-24 11:13:49 +01:00 committed by GitHub
parent 14dd2cdcdb
commit 947f86f178
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -60,6 +60,7 @@ export interface NotificationConfig {
bottom?: number;
prefixCls?: string;
getContainer?: () => HTMLElement;
placement?: NotificationPlacement;
maxCount?: number;
rtl?: boolean;
}

View File

@ -110,13 +110,13 @@ export function useInternalNotification(
description,
icon,
type,
placement = 'topRight',
btn,
className,
...restConfig
} = config;
return originOpen({
placement: 'topRight',
...restConfig,
content: (
<PureContent
@ -128,7 +128,6 @@ export function useInternalNotification(
btn={btn}
/>
),
placement,
className: classNames(type && `${noticePrefixCls}-${type}`, hashId, className),
});
};