Skip to content

Commit 4b68fc7

Browse files
committed
refactor: align notification list render section
1 parent 7b7f520 commit 4b68fc7

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

src/NotificationList.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,16 @@ export interface NotificationListProps {
3636
}
3737

3838
const NotificationList: React.FC<NotificationListProps> = (props) => {
39-
const { configList = [], pauseOnHover, classNames, styles, maxCount, motion, placement } = props;
39+
const {
40+
configList = [],
41+
prefixCls = 'rc-notification',
42+
pauseOnHover,
43+
classNames,
44+
styles,
45+
maxCount,
46+
motion,
47+
placement,
48+
} = props;
4049

4150
// ========================== Data ==========================
4251
const mergedConfigList =
@@ -51,8 +60,16 @@ const NotificationList: React.FC<NotificationListProps> = (props) => {
5160
const placementMotion = typeof motion === 'function' ? motion(placement) : motion;
5261

5362
// ========================= Render =========================
63+
const listPrefixCls = `${prefixCls}-list`;
64+
5465
return (
55-
<CSSMotionList component="div" keys={keys} motionAppear {...placementMotion}>
66+
<CSSMotionList
67+
component="div"
68+
keys={keys}
69+
motionAppear
70+
className={clsx(listPrefixCls, `${listPrefixCls}-${placement}`)}
71+
{...placementMotion}
72+
>
5673
{({ config, className, style }, nodeRef) => (
5774
<Notification
5875
{...config}

0 commit comments

Comments
 (0)