|
|
|
@ -88,18 +88,17 @@ export default class NoticeIcon extends Component<NoticeIconProps> { |
|
|
|
if (!children) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
const panes = React.Children.map( |
|
|
|
children, |
|
|
|
(child: React.ReactElement<NoticeIconTabProps>): React.ReactNode => { |
|
|
|
const panes: ReactNodeArray = []; |
|
|
|
React.Children.forEach(children, (child: React.ReactElement<NoticeIconTabProps>): void => { |
|
|
|
if (!child) { |
|
|
|
return null; |
|
|
|
return; |
|
|
|
} |
|
|
|
const { list, title, count, tabKey, showClear, showViewMore } = child.props; |
|
|
|
const len = list && list.length ? list.length : 0; |
|
|
|
const msgCount = count || count === 0 ? count : len; |
|
|
|
const tabTitle: string = msgCount > 0 ? `${title} (${msgCount})` : title; |
|
|
|
return ( |
|
|
|
<TabPane tab={tabTitle} key={title}> |
|
|
|
panes.push( |
|
|
|
<TabPane tab={tabTitle} key={tabKey}> |
|
|
|
<NoticeList |
|
|
|
clearText={clearText} |
|
|
|
viewMoreText={viewMoreText} |
|
|
|
@ -112,10 +111,9 @@ export default class NoticeIcon extends Component<NoticeIconProps> { |
|
|
|
title={title} |
|
|
|
{...child.props} |
|
|
|
/> |
|
|
|
</TabPane> |
|
|
|
); |
|
|
|
}, |
|
|
|
</TabPane>, |
|
|
|
); |
|
|
|
}); |
|
|
|
return ( |
|
|
|
<> |
|
|
|
<Spin spinning={loading} delay={300}> |
|
|
|
|