You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

413 lines
14 KiB

import React from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
use ant design icons 4.0 (#18217) * feat: use @ant-design/icons@4.0 * feat: use createFromIconfontCN to make site works * feat: update doc for Icon * feat: use icon in component Alert * feat: use icon in component Avatar * feat: use icon in component Breadcrumb * feat: use icon in component Button * feat: use icon in component Cascader * feat: use icon in component Collapse * feat: use icon in component Datepicker * feat: use icon in component Dropdown * feat: use icon in component Form * feat: use icon in component Input * feat: use icon in component InputNumber * feat: use icon in component Layout * feat: use icon in component Mention * feat: use icon in component Message * feat: use icon in component Modal * feat: use icon in component Notification * feat: use icon in component PageHeader * feat: use icon in component Pagination * feat: use icon in component Popconfirm * feat: use icon in component Progress * feat: use icon in component Rate * feat: use icon in component Result * feat: use icon in component Select * feat: use icon in component Step * feat: use icon in component Switch * feat: use icon in component Table * feat: use icon in component Tab * feat: use icon in component Tag * feat: handle rest component which using Icon * fix: remove unused vars * feat: use latest alpha ant design icons * fix: failed test in uploadlist.test.js * test: update snapshot for icons * doc: add Icon for site * doc: use @ant-design/icons in site * chore: use latest icons * fix: tslint issue * fix: test cases * fix: types for react * fix: lint rules for import orders * fix: use @ant-design/icons@4.0.0-alpha.5 to avoid insert css in server render * fix: eslint error in demo/**.md * inject antd icons * update snapshot * fix site * doc: update docs * fix: code snippets icon in site * feat: use latest @ant-design/icons * fix: icon props in message
5 years ago
import { Modal, message, Row, Col } from 'antd';
import { Link } from 'bisheng/router';
use ant design icons 4.0 (#18217) * feat: use @ant-design/icons@4.0 * feat: use createFromIconfontCN to make site works * feat: update doc for Icon * feat: use icon in component Alert * feat: use icon in component Avatar * feat: use icon in component Breadcrumb * feat: use icon in component Button * feat: use icon in component Cascader * feat: use icon in component Collapse * feat: use icon in component Datepicker * feat: use icon in component Dropdown * feat: use icon in component Form * feat: use icon in component Input * feat: use icon in component InputNumber * feat: use icon in component Layout * feat: use icon in component Mention * feat: use icon in component Message * feat: use icon in component Modal * feat: use icon in component Notification * feat: use icon in component PageHeader * feat: use icon in component Pagination * feat: use icon in component Popconfirm * feat: use icon in component Progress * feat: use icon in component Rate * feat: use icon in component Result * feat: use icon in component Select * feat: use icon in component Step * feat: use icon in component Switch * feat: use icon in component Table * feat: use icon in component Tab * feat: use icon in component Tag * feat: handle rest component which using Icon * fix: remove unused vars * feat: use latest alpha ant design icons * fix: failed test in uploadlist.test.js * test: update snapshot for icons * doc: add Icon for site * doc: use @ant-design/icons in site * chore: use latest icons * fix: tslint issue * fix: test cases * fix: types for react * fix: lint rules for import orders * fix: use @ant-design/icons@4.0.0-alpha.5 to avoid insert css in server render * fix: eslint error in demo/**.md * inject antd icons * update snapshot * fix site * doc: update docs * fix: code snippets icon in site * feat: use latest @ant-design/icons * fix: icon props in message
5 years ago
import Icon from '../Icon';
import { isLocalStorageNameSupported, loadScript, getLocalizedPathname } from '../utils';
import ColorPicker from '../Color/ColorPicker';
class Footer extends React.Component {
constructor(props) {
super(props);
this.lessLoaded = false;
this.state = {
color: '#1890ff',
};
}
componentDidMount() {
// for some iOS
// http://stackoverflow.com/a/14555361
if (!isLocalStorageNameSupported()) {
return;
}
// 大版本发布后全局弹窗提示
// 1. 点击『知道了』之后不再提示
// 2. 超过截止日期后不再提示
if (
6 years ago
localStorage.getItem('antd@3.0.0-notification-sent') !== 'true' &&
Date.now() < new Date('2017/12/20').getTime()
) {
this.infoNewVersion();
}
}
6 years ago
handleColorChange = color => {
const changeColor = () => {
6 years ago
const {
intl: { messages },
} = this.props;
window.less
.modifyVars({
'@primary-color': color,
})
.then(() => {
Icon.setTwoToneColor({ primaryColor: color });
message.success(messages['app.footer.primary-color-changed']);
this.setState({ color });
});
};
6 years ago
const lessUrl = 'https://gw.alipayobjects.com/os/lib/less.js/3.8.1/less.min.js';
if (this.lessLoaded) {
changeColor();
} else {
window.less = {
async: true,
6 years ago
javascriptEnabled: true,
};
loadScript(lessUrl).then(() => {
this.lessLoaded = true;
changeColor();
});
}
6 years ago
};
infoNewVersion() {
6 years ago
const {
intl: { messages },
} = this.props;
Modal.info({
title: messages['app.publish.title'],
content: (
<div>
6 years ago
<img
src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
alt="Ant Design"
/>
<p>
{messages['app.publish.greeting']}
6 years ago
<a target="_blank" rel="noopener noreferrer" href="/changelog">
antd@3.0.0
</a>
{messages['app.publish.intro']}
{messages['app.publish.old-version-guide']}
6 years ago
<a target="_blank" rel="noopener noreferrer" href="http://2x.ant.design">
2x.ant.design
</a>
{messages['app.publish.old-version-tips']}
</p>
</div>
),
okText: 'OK',
onOk: () => localStorage.setItem('antd@3.0.0-notification-sent', 'true'),
className: 'new-version-info-modal',
width: 470,
});
}
render() {
const { intl = {} } = this.props;
const { color } = this.state;
const isZhCN = intl.locale === 'zh-CN';
return (
<footer id="footer">
<div className="footer-wrap">
<Row gutter={16}>
<Col md={6} sm={24} xs={24}>
<div className="footer-center">
6 years ago
<h2>
<FormattedMessage id="app.footer.resources" />
</h2>
<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>
<span>Ant Design of Angular</span>
</div>
<div>
<a href="http://ng.mobile.ant.design">NG-ZORRO-MOBILE</a>
</div>
<div>
<a href="http://vue.ant.design">Ant Design Vue</a>
</div>
<div>
6 years ago
<a target="_blank" rel="noopener noreferrer" href="http://kitchen.alipay.com">
Kitchen
</a>
<span> - </span>
<FormattedMessage id="app.footer.kitchen" />
</div>
<div>
<a target="_blank" rel="noopener noreferrer" href="http://landing.ant.design">
Ant Design Landing
</a>
<span> - </span>
<FormattedMessage id="app.footer.landing" />
</div>
<div>
<a href="http://scaffold.ant.design">Scaffolds</a>
<span> - </span>
<FormattedMessage id="app.footer.scaffolds" />
</div>
<div>
6 years ago
<a target="_blank" rel="noopener noreferrer" href="http://umijs.org/">
Umi
</a>{' '}
- <FormattedMessage id="app.footer.umi" />
</div>
<div>
6 years ago
<a target="_blank" rel="noopener noreferrer" href="https://github.com/dvajs/dva">
dva
</a>{' '}
- <FormattedMessage id="app.footer.dva" />
</div>
<div>
6 years ago
<a target="_blank" rel="noopener noreferrer" href="http://motion.ant.design">
Ant Motion
</a>
<span> - </span>
<FormattedMessage id="app.footer.motion" />
</div>
<div>
<Link to={getLocalizedPathname('/docs/spec/download', isZhCN)}>
<FormattedMessage id="app.footer.design-resources" />
</Link>
</div>
<div>
<a target="_blank" rel="noopener noreferrer" href="http://ant-design.gitee.io/">
<FormattedMessage id="app.footer.chinamirror" />
</a>
</div>
</div>
</Col>
<Col md={6} sm={24} xs={24}>
<div className="footer-center">
6 years ago
<h2>
<FormattedMessage id="app.footer.community" />
</h2>
<div>
6 years ago
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/websemantics/awesome-ant-design"
>
<Icon type="ant-design" /> <FormattedMessage id="app.footer.awesome" />
</a>
</div>
<div>
<a target="_blank" rel="noopener noreferrer" href="http://medium.com/ant-design/">
<Icon type="medium" /> Medium
</a>
</div>
<div>
6 years ago
<a
target="_blank"
rel="noopener noreferrer"
href="http://twitter.com/antdesignui"
>
<Icon type="twitter" style={{ color: '#1DA1F2' }} /> Twitter
</a>
</div>
<div>
6 years ago
<a
target="_blank"
rel="noopener noreferrer"
href="http://zhuanlan.zhihu.com/antdesign"
>
<Icon type="zhihu" style={{ color: '#0084ff' }} />{' '}
<FormattedMessage id="app.footer.zhihu" />
</a>
</div>
<div>
6 years ago
<a
target="_blank"
rel="noopener noreferrer"
href="http://zhuanlan.zhihu.com/xtech"
>
<Icon type="zhihu" style={{ color: '#0084ff' }} />{' '}
<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>
<Link to={getLocalizedPathname('/docs/spec/work-with-us', isZhCN)}>
<FormattedMessage id="app.footer.work_with_us" />
</Link>
</div>
</div>
</Col>
<Col md={6} sm={24} xs={24}>
<div className="footer-center">
6 years ago
<h2>
<FormattedMessage id="app.footer.help" />
</h2>
<div>
6 years ago
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/ant-design/ant-design"
>
GitHub
</a>
</div>
<div>
<Link to={getLocalizedPathname('/changelog', isZhCN)}>
<FormattedMessage id="app.footer.change-log" />
</Link>
</div>
<div>
6 years ago
<a
target="_blank"
rel="noopener noreferrer"
href="https://www.yuque.com/ant-design/course"
>
<FormattedMessage id="app.footer.course" />
</a>
</div>
<div>
<Link to={getLocalizedPathname('/docs/react/faq', isZhCN)}>
<FormattedMessage id="app.footer.faq" />
</Link>
</div>
<div>
6 years ago
<a
target="_blank"
rel="noopener noreferrer"
href="https://gitter.im/ant-design/ant-design"
>
<FormattedMessage id="app.footer.discuss-cn" />
</a>
</div>
<div>
6 years ago
<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>
6 years ago
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/ant-design/ant-design/issues"
>
<FormattedMessage id="app.footer.issues" />
</a>
</div>
<div>
6 years ago
<a
target="_blank"
rel="noopener noreferrer"
href="http://stackoverflow.com/questions/tagged/antd"
>
<FormattedMessage id="app.footer.stackoverflow" />
</a>
</div>
<div>
6 years ago
<a
target="_blank"
rel="noopener noreferrer"
href="https://segmentfault.com/t/antd"
>
<FormattedMessage id="app.footer.segmentfault" />
</a>
</div>
</div>
</Col>
<Col md={6} sm={24} xs={24}>
<div className="footer-center">
<h2>
6 years ago
<img
className="title-icon"
src="https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg"
alt="AFX Cloud"
/>
<FormattedMessage id="app.footer.more-product" />
</h2>
<div>
<a target="_blank" rel="noopener noreferrer" href="https://yuque.com/">
6 years ago
<Icon type="yuque" theme="filled" style={{ color: '#25b864' }} />{' '}
<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>
<div>
6 years ago
<a target="_blank" rel="noopener noreferrer" href="https://antv.alipay.com/">
AntV
</a>
<span> - </span>
<FormattedMessage id="app.footer.data-vis" />
</div>
<div>
6 years ago
<a target="_blank" rel="noopener noreferrer" href="https://eggjs.org/">
Egg
</a>
<span> - </span>
<FormattedMessage id="app.footer.eggjs" />
</div>
<div>
<a target="_blank" rel="noopener noreferrer" href="http://xtech.antfin.com/">
<FormattedMessage id="app.footer.xtech" />
</a>
</div>
<div style={{ marginTop: 20 }}>
<ColorPicker
type="sketch"
small
color={color}
position="top"
presetColors={[
'#F5222D',
'#FA541C',
'#FA8C16',
'#FAAD14',
'#FADB14',
'#A0D911',
'#52C41A',
'#13C2C2',
'#1890FF',
'#2F54EB',
'#722ED1',
'#EB2F96',
]}
onChangeComplete={this.handleColorChange}
/>
</div>
</div>
</Col>
</Row>
</div>
<div className="bottom-bar">
Made with <span className="heart"></span> by
<a target="_blank" rel="noopener noreferrer" href="https://xtech.antfin.com">
<FormattedMessage id="app.footer.company" />
</a>
</div>
</footer>
);
}
}
export default injectIntl(Footer);