2016-02-29 14:08:40 +08:00
|
|
|
import React from 'react';
|
2016-09-28 13:43:32 +08:00
|
|
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
2017-12-01 20:27:44 +08:00
|
|
|
import { Modal, message, Row, Col } from 'antd';
|
2017-12-01 20:37:14 +08:00
|
|
|
import { isLocalStorageNameSupported, loadScript } from '../utils';
|
2017-09-03 22:15:33 +08:00
|
|
|
import ColorPicker from '../Color/ColorPicker';
|
2016-05-17 12:04:44 +08:00
|
|
|
|
2016-09-28 13:43:32 +08:00
|
|
|
class Footer extends React.Component {
|
2017-09-03 22:15:33 +08:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
2017-09-18 17:31:48 +08:00
|
|
|
this.lessLoaded = false;
|
|
|
|
|
2017-09-03 22:15:33 +08:00
|
|
|
this.state = {
|
2017-11-27 15:36:58 +08:00
|
|
|
color: '#1890ff',
|
2017-09-03 22:15:33 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-05-15 21:14:27 +08:00
|
|
|
componentDidMount() {
|
2016-05-17 12:04:44 +08:00
|
|
|
// for some iOS
|
|
|
|
// http://stackoverflow.com/a/14555361
|
|
|
|
if (!isLocalStorageNameSupported()) {
|
|
|
|
return;
|
|
|
|
}
|
2016-05-15 21:14:27 +08:00
|
|
|
// 大版本发布后全局弹窗提示
|
|
|
|
// 1. 点击『知道了』之后不再提示
|
|
|
|
// 2. 超过截止日期后不再提示
|
2016-11-21 14:39:15 +08:00
|
|
|
if (
|
2018-06-22 21:05:13 +08:00
|
|
|
localStorage.getItem('antd@3.0.0-notification-sent') !== 'true'
|
|
|
|
&& Date.now() < new Date('2017/12/20').getTime()
|
2016-11-21 14:39:15 +08:00
|
|
|
) {
|
2016-09-28 13:43:32 +08:00
|
|
|
this.infoNewVersion();
|
2016-05-15 21:14:27 +08:00
|
|
|
}
|
|
|
|
}
|
2016-03-17 15:46:07 +08:00
|
|
|
|
2017-09-03 22:15:33 +08:00
|
|
|
handleColorChange = (color) => {
|
2017-09-18 17:31:48 +08:00
|
|
|
const changeColor = () => {
|
2018-06-22 21:05:13 +08:00
|
|
|
const { intl: { messages } } = this.props;
|
2017-09-18 17:31:48 +08:00
|
|
|
window.less.modifyVars({
|
|
|
|
'@primary-color': color,
|
|
|
|
}).then(() => {
|
|
|
|
message.success(messages['app.footer.primary-color-changed']);
|
|
|
|
this.setState({ color });
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
const lessUrl = 'https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.2/less.min.js';
|
|
|
|
|
|
|
|
if (this.lessLoaded) {
|
|
|
|
changeColor();
|
|
|
|
} else {
|
|
|
|
window.less = {
|
|
|
|
async: true,
|
|
|
|
};
|
|
|
|
loadScript(lessUrl).then(() => {
|
|
|
|
this.lessLoaded = true;
|
|
|
|
changeColor();
|
|
|
|
});
|
|
|
|
}
|
2017-09-03 22:15:33 +08:00
|
|
|
}
|
|
|
|
|
2016-09-28 13:43:32 +08:00
|
|
|
infoNewVersion() {
|
2018-06-22 21:05:13 +08:00
|
|
|
const { intl: { messages } } = this.props;
|
2016-09-28 13:43:32 +08:00
|
|
|
Modal.info({
|
|
|
|
title: messages['app.publish.title'],
|
|
|
|
content: (
|
|
|
|
<div>
|
2017-12-01 15:42:54 +08:00
|
|
|
<img src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" alt="Ant Design" />
|
2016-09-28 13:43:32 +08:00
|
|
|
<p>
|
|
|
|
{messages['app.publish.greeting']}
|
2017-12-01 15:42:54 +08:00
|
|
|
<a target="_blank" rel="noopener noreferrer" href="/changelog">antd@3.0.0</a>
|
2016-09-28 13:43:32 +08:00
|
|
|
{messages['app.publish.intro']}
|
|
|
|
{messages['app.publish.old-version-guide']}
|
2017-12-01 15:42:54 +08:00
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://2x.ant.design">2x.ant.design</a>
|
2016-09-28 13:43:32 +08:00
|
|
|
{messages['app.publish.old-version-tips']}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
),
|
|
|
|
okText: 'OK',
|
2017-12-01 15:42:54 +08:00
|
|
|
onOk: () => localStorage.setItem('antd@3.0.0-notification-sent', 'true'),
|
2016-09-28 13:43:32 +08:00
|
|
|
className: 'new-version-info-modal',
|
|
|
|
width: 470,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2016-02-29 14:08:40 +08:00
|
|
|
render() {
|
2018-06-22 21:05:13 +08:00
|
|
|
const { color } = this.state;
|
2016-03-01 14:19:50 +08:00
|
|
|
return (
|
2018-01-09 15:38:06 +08:00
|
|
|
<footer id="footer">
|
2017-11-27 15:36:58 +08:00
|
|
|
<div className="footer-wrap">
|
|
|
|
<Row>
|
2018-01-04 20:00:38 +08:00
|
|
|
<Col md={6} sm={24} xs={24}>
|
2017-11-27 15:36:58 +08:00
|
|
|
<div className="footer-center">
|
2018-02-11 17:54:55 +08:00
|
|
|
<h2><FormattedMessage id="app.footer.resources" /></h2>
|
2017-11-27 15:36:58 +08:00
|
|
|
<div>
|
|
|
|
<a href="http://pro.ant.design">Ant Design Pro</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a href="http://mobile.ant.design">Ant Design Mobile</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a href="http://ng.ant.design">NG-ZORRO</a>
|
|
|
|
<span> - </span>
|
|
|
|
Ant Design of Angular
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank " href="https://github.com/websemantics/awesome-ant-design">
|
|
|
|
<FormattedMessage id="app.footer.awesome" />
|
|
|
|
</a>
|
|
|
|
</div>
|
2018-05-14 19:52:51 +08:00
|
|
|
<div>
|
2018-05-14 21:25:38 +08:00
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://kitchen.alipay.com">Kitchen</a>
|
2018-05-14 19:52:51 +08:00
|
|
|
<span> - </span>
|
|
|
|
<FormattedMessage id="app.footer.kitchen" />
|
|
|
|
</div>
|
2017-11-27 15:36:58 +08:00
|
|
|
<div>
|
|
|
|
<a href="http://scaffold.ant.design">Scaffolds</a>
|
|
|
|
<span> - </span>
|
|
|
|
<FormattedMessage id="app.footer.scaffolds" />
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="https://github.com/dvajs/dva">dva</a> - <FormattedMessage id="app.footer.dva" />
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://motion.ant.design">Ant Motion</a>
|
|
|
|
<span> - </span>
|
|
|
|
<FormattedMessage id="app.footer.motion" />
|
|
|
|
</div>
|
|
|
|
<div>
|
2018-01-06 10:20:03 +08:00
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://library.ant.design/">Axure Library</a>
|
2017-11-27 15:36:58 +08:00
|
|
|
<span> - </span>
|
|
|
|
<FormattedMessage id="app.footer.antd-library" />
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://ux.ant.design">Ant UX</a>
|
|
|
|
<span> - </span>
|
|
|
|
<FormattedMessage id="app.footer.antux" />
|
|
|
|
</div>
|
2018-02-11 17:54:55 +08:00
|
|
|
<div>
|
|
|
|
<a target="_blank " href="http://ant-design.gitee.io/">
|
|
|
|
<FormattedMessage id="app.footer.chinamirror" />
|
|
|
|
</a>
|
|
|
|
</div>
|
2017-11-27 15:36:58 +08:00
|
|
|
</div>
|
|
|
|
</Col>
|
2018-01-04 20:00:38 +08:00
|
|
|
<Col md={6} sm={24} xs={24}>
|
2017-11-27 15:36:58 +08:00
|
|
|
<div className="footer-center">
|
|
|
|
<h2><FormattedMessage id="app.footer.community" /></h2>
|
2018-02-11 17:54:55 +08:00
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://zhuanlan.zhihu.com/antdesign">
|
|
|
|
<FormattedMessage id="app.footer.zhihu" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://medium.com/ant-design/">
|
|
|
|
Medium
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://twitter.com/antdesignui">
|
|
|
|
Twitter
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://zhuanlan.zhihu.com/xtech">
|
|
|
|
<FormattedMessage id="app.footer.zhihu.xtech" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://seeconf.alipay.com/">
|
|
|
|
SEE Conf
|
|
|
|
</a>
|
|
|
|
<span> - </span>
|
|
|
|
<FormattedMessage id="app.footer.seeconf" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Col>
|
|
|
|
<Col md={6} sm={24} xs={24}>
|
|
|
|
<div className="footer-center">
|
|
|
|
<h2><FormattedMessage id="app.footer.help" /></h2>
|
|
|
|
<div>
|
|
|
|
<a target="_blank " href="https://github.com/ant-design/ant-design">
|
|
|
|
GitHub
|
|
|
|
</a>
|
|
|
|
</div>
|
2017-11-27 15:36:58 +08:00
|
|
|
<div>
|
|
|
|
<a href="/changelog">
|
|
|
|
<FormattedMessage id="app.footer.change-log" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="https://github.com/ant-design/ant-design/wiki/FAQ">
|
|
|
|
<FormattedMessage id="app.footer.faq" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="https://gitter.im/ant-design/ant-design">
|
|
|
|
<FormattedMessage id="app.footer.discuss-cn" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="https://gitter.im/ant-design/ant-design-english">
|
|
|
|
<FormattedMessage id="app.footer.discuss-en" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://new-issue.ant.design/">
|
|
|
|
<FormattedMessage id="app.footer.bug-report" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="https://github.com/ant-design/ant-design/issues">
|
|
|
|
<FormattedMessage id="app.footer.issues" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://stackoverflow.com/questions/tagged/antd">
|
|
|
|
<FormattedMessage id="app.footer.stackoverflow" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="https://segmentfault.com/t/antd">
|
|
|
|
<FormattedMessage id="app.footer.segmentfault" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Col>
|
2018-01-04 20:00:38 +08:00
|
|
|
<Col md={6} sm={24} xs={24}>
|
2017-11-27 15:36:58 +08:00
|
|
|
<div className="footer-center">
|
|
|
|
<h2>
|
2018-05-21 23:47:22 +08:00
|
|
|
<img className="title-icon" src="https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg" alt="AFX Cloud" />
|
2017-11-27 15:36:58 +08:00
|
|
|
<FormattedMessage id="app.footer.more-product" />
|
|
|
|
</h2>
|
2018-02-11 17:54:55 +08:00
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="https://yuque.com/">
|
|
|
|
<FormattedMessage id="app.footer.yuque" />
|
|
|
|
</a>
|
|
|
|
<span> - </span>
|
|
|
|
<FormattedMessage id="app.footer.yuque.slogan" />
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="https://yunfengdie.com/">
|
|
|
|
<FormattedMessage id="app.footer.fengdie" />
|
|
|
|
</a>
|
|
|
|
<span> - </span>
|
|
|
|
<FormattedMessage id="app.footer.fengdie.slogan" />
|
|
|
|
</div>
|
2017-11-28 16:15:22 +08:00
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="https://antv.alipay.com/">AntV</a>
|
|
|
|
<span> - </span>
|
|
|
|
<FormattedMessage id="app.footer.data-vis" />
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="https://eggjs.org/">Egg</a>
|
|
|
|
<span> - </span>
|
|
|
|
<FormattedMessage id="app.footer.eggjs" />
|
|
|
|
</div>
|
2018-02-11 17:54:55 +08:00
|
|
|
<div>
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="http://xcloud.alipay.com/">
|
|
|
|
<FormattedMessage id="app.footer.xcloud" />
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div style={{ marginTop: 20 }}>
|
|
|
|
<ColorPicker
|
|
|
|
type="sketch"
|
|
|
|
small
|
2018-06-22 21:05:13 +08:00
|
|
|
color={color}
|
2018-02-11 17:54:55 +08:00
|
|
|
position="top"
|
|
|
|
presetColors={[
|
|
|
|
'#F5222D',
|
|
|
|
'#FA541C',
|
|
|
|
'#FA8C16',
|
|
|
|
'#FAAD14',
|
|
|
|
'#FADB14',
|
|
|
|
'#A0D911',
|
|
|
|
'#52C41A',
|
|
|
|
'#13C2C2',
|
|
|
|
'#1890FF',
|
|
|
|
'#2F54EB',
|
|
|
|
'#722ED1',
|
|
|
|
'#EB2F96',
|
|
|
|
]}
|
|
|
|
onChangeComplete={this.handleColorChange}
|
|
|
|
/>
|
|
|
|
</div>
|
2017-11-27 15:36:58 +08:00
|
|
|
</div>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</div>
|
2018-05-15 12:39:05 +08:00
|
|
|
<div className="bottom-bar">
|
|
|
|
Made with <span className="heart">❤</span> by
|
|
|
|
<a target="_blank" rel="noopener noreferrer" href="https://yuque.com/afx/blog">
|
|
|
|
<FormattedMessage id="app.footer.company" />
|
|
|
|
</a>
|
|
|
|
</div>
|
2016-03-01 14:19:50 +08:00
|
|
|
</footer>
|
|
|
|
);
|
2016-02-29 14:08:40 +08:00
|
|
|
}
|
|
|
|
}
|
2016-09-28 13:43:32 +08:00
|
|
|
|
|
|
|
export default injectIntl(Footer);
|