提供一个关闭功能,点击后 localStorage 存一下就不弹了

This commit is contained in:
天可 2019-08-23 13:27:04 +08:00
parent a04794261c
commit 2cf0577e4f

View File

@ -94,6 +94,9 @@ class PicSearcher extends Component<PicSearcherProps, PicSearcherState> {
fileList: [],
icons: [],
}));
if (!localStorage.getItem('disableIconTip')) {
localStorage.setItem('disableIconTip', 'true');
}
};
onCopied = (text: string) => {
@ -111,7 +114,10 @@ class PicSearcher extends Component<PicSearcherProps, PicSearcherState> {
const { modalVisible, icons, fileList, loading } = this.state;
return (
<div className="icon-pic-searcher">
<Popover content={messages[`app.docs.components.icon.pic-searcher.intro`]} visible>
<Popover
content={messages[`app.docs.components.icon.pic-searcher.intro`]}
visible={!localStorage.getItem('disableIconTip')}
>
<Icon type="camera" className="icon-pic-btn" onClick={this.toggleModal} />
</Popover>
<Modal