diff --git a/src/components/NoticeIcon/NoticeIconTab.d.ts b/src/components/NoticeIcon/NoticeIconTab.d.ts index 99be5957f0a6eb3c7953a27791e48655a60e3773..f9786f85d0b097d6df1d68ffe5207ccf0df31dd8 100644 --- a/src/components/NoticeIcon/NoticeIconTab.d.ts +++ b/src/components/NoticeIcon/NoticeIconTab.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; export interface INoticeIconData { - avatar?: string; + avatar?: string|React.ReactNode; title?: React.ReactNode; description?: React.ReactNode; datetime?: React.ReactNode; diff --git a/src/components/NoticeIcon/NoticeList.js b/src/components/NoticeIcon/NoticeList.js index cafd65628ab60fb69f111789b76fd0b699ab0f49..97b7e29f69dd3940dbc26659185bec081bc1e983 100644 --- a/src/components/NoticeIcon/NoticeList.js +++ b/src/components/NoticeIcon/NoticeList.js @@ -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' ? ( + + ) : ( + item.avatar + ) + ) : null; + return ( onClick(item)}> : null} + avatar={{leftIcon}} title={
{item.title} diff --git a/src/components/NoticeIcon/NoticeList.less b/src/components/NoticeIcon/NoticeList.less index f99d59e8c8a4d8a7f69ef84ecc7ba41a698be9d0..e34efdc9da182b0530544ef3162200583ba21906 100644 --- a/src/components/NoticeIcon/NoticeList.less +++ b/src/components/NoticeIcon/NoticeList.less @@ -18,6 +18,9 @@ background: #fff; margin-top: 4px; } + .iconElement { + font-size: 32px; + } &.read { opacity: 0.4; diff --git a/src/components/NoticeIcon/index.en-US.md b/src/components/NoticeIcon/index.en-US.md index e7448060e80ff1b97126ec72bc02b847b5752400..3ee5677b46f57be4289b2bcaaaf49cfedcbe24bf 100644 --- a/src/components/NoticeIcon/index.en-US.md +++ b/src/components/NoticeIcon/index.en-US.md @@ -36,7 +36,7 @@ emptyImage | image when list is empty | string | - Property | Description | Type | Default ----|------|-----|------ -avatar | avatar img url | string | - +avatar | avatar img url | string \| ReactNode | - title | title | ReactNode | - description | description info | ReactNode | - datetime | Timestamps | ReactNode | - diff --git a/src/components/NoticeIcon/index.zh-CN.md b/src/components/NoticeIcon/index.zh-CN.md index b396bae39e061d81423b48e29050e914e2b8ec92..b5aa3c8fae39b7f38d55d1be2da2bf816579975c 100644 --- a/src/components/NoticeIcon/index.zh-CN.md +++ b/src/components/NoticeIcon/index.zh-CN.md @@ -36,7 +36,7 @@ emptyImage | 针对每个 Tab 定制空数据图片 | string | - 参数 | 说明 | 类型 | 默认值 ----|------|-----|------ -avatar | 头像图片链接 | string | - +avatar | 头像图片链接 | string \| ReactNode | - title | 标题 | ReactNode | - description | 描述信息 | ReactNode | - datetime | 时间戳 | ReactNode | -