|
|
@@ -28,11 +28,19 @@ export default function NoticeList({
|
|
|
const itemCls = classNames(styles.item, {
|
|
|
[styles.read]: item.read,
|
|
|
});
|
|
|
+ const leftIcon = item.avatar ? (
|
|
|
+ typeof item.avatar === 'string' ? (
|
|
|
+ <Avatar className={styles.avatar} src={item.avatar} />
|
|
|
+ ) : (
|
|
|
+ item.avatar
|
|
|
+ )
|
|
|
+ ) : null;
|
|
|
+
|
|
|
return (
|
|
|
<List.Item className={itemCls} key={item.key || i} onClick={() => onClick(item)}>
|
|
|
<List.Item.Meta
|
|
|
className={styles.meta}
|
|
|
- avatar={item.avatar ? <Avatar className={styles.avatar} src={item.avatar} /> : null}
|
|
|
+ avatar={<span className={styles.iconElement}>{leftIcon}</span>}
|
|
|
title={
|
|
|
<div className={styles.title}>
|
|
|
{item.title}
|