Skip to content

Commit 9401b19

Browse files
author
chenghao
committed
🔥🎨 add profile
1 parent 03e739c commit 9401b19

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/App.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { Layout } from 'antd';
2+
import { Layout, notification, Icon } from 'antd';
33
import './style/index.less';
44
import SiderCustom from './components/SiderCustom';
55
import HeaderCustom from './components/HeaderCustom';
@@ -26,6 +26,28 @@ class App extends Component {
2626
// console.log(document.body.clientWidth);
2727
}
2828
}
29+
componentDidMount() {
30+
const openNotification = () => {
31+
notification.open({
32+
message: '博主-yezihaohao',
33+
description: (
34+
<div>
35+
<p>
36+
GitHub地址: <a href="https://github.com/yezihaohao" target="_blank" rel="noopener noreferrer">https://github.com/yezihaohao</a>
37+
</p>
38+
<p>
39+
博客地址: <a href="https://yezihaohao.github.io/" target="_blank" rel="noopener noreferrer">https://yezihaohao.github.io/</a>
40+
</p>
41+
</div>
42+
),
43+
icon: <Icon type="smile-circle" style={{ color: 'red' }} />,
44+
duration: 0,
45+
});
46+
localStorage.setItem('isFirst', JSON.stringify(true));
47+
};
48+
const isFirst = JSON.parse(localStorage.getItem('isFirst'));
49+
!isFirst && openNotification();
50+
}
2951
getClientWidth = () => { // 获取当前浏览器宽度并设置responsive管理响应式
3052
const { receiveData } = this.props;
3153
const clientWidth = document.body.clientWidth;

0 commit comments

Comments
 (0)