From fab29f3edf2af878b6de212eefbff2872e33834b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Sun, 30 Sep 2018 16:27:29 +0800 Subject: [PATCH] remove umi/locale in components --- src/components/GlobalHeader/RightContent.js | 4 ++++ src/components/NoticeIcon/index.js | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/GlobalHeader/RightContent.js b/src/components/GlobalHeader/RightContent.js index dce334c6..50e1e794 100644 --- a/src/components/GlobalHeader/RightContent.js +++ b/src/components/GlobalHeader/RightContent.js @@ -109,6 +109,10 @@ export default class GlobalHeaderRight extends PureComponent { onItemClick={(item, tabProps) => { console.log(item, tabProps); // eslint-disable-line }} + locale={{ + emptyText: formatMessage({ id: 'component.noticeIcon.empty' }), + clear: formatMessage({ id: 'component.noticeIcon.clear' }), + }} onClear={onNoticeClear} onPopupVisibleChange={onNoticeVisibleChange} loading={fetchingNotices} diff --git a/src/components/NoticeIcon/index.js b/src/components/NoticeIcon/index.js index 64146222..61f56b92 100644 --- a/src/components/NoticeIcon/index.js +++ b/src/components/NoticeIcon/index.js @@ -1,5 +1,4 @@ import React, { PureComponent } from 'react'; -import { formatMessage } from 'umi/locale'; import { Popover, Icon, Tabs, Badge, Spin } from 'antd'; import classNames from 'classnames'; import List from './NoticeList'; @@ -17,8 +16,8 @@ export default class NoticeIcon extends PureComponent { onClear: () => {}, loading: false, locale: { - emptyText: formatMessage({ id: 'component.noticeIcon.empty' }), - clear: formatMessage({ id: 'component.noticeIcon.clear' }), + emptyText: 'No notifications', + clear: 'Clear', }, emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg', }; -- GitLab