2016-03-03 17:23:08 +08:00
|
|
|
import React from 'react';
|
2017-01-17 15:24:13 +08:00
|
|
|
import { Link } from 'bisheng/router';
|
2016-09-01 11:53:55 +08:00
|
|
|
import { FormattedMessage } from 'react-intl';
|
2016-11-11 17:56:05 +08:00
|
|
|
import ScrollElement from 'rc-scroll-anim/lib/ScrollElement';
|
2016-03-14 15:00:11 +08:00
|
|
|
import GitHubButton from 'react-github-button';
|
2017-11-30 21:38:48 +08:00
|
|
|
import { Icon, Button } from 'antd';
|
2016-03-30 19:14:09 +08:00
|
|
|
import QueueAnim from 'rc-queue-anim';
|
2016-12-09 13:02:16 +08:00
|
|
|
import * as utils from '../utils';
|
2016-03-03 17:23:08 +08:00
|
|
|
|
2016-09-27 10:06:34 +08:00
|
|
|
function typeFunc(a) {
|
|
|
|
if (a.key === 'line') {
|
2017-11-30 21:38:48 +08:00
|
|
|
return 'left';
|
2016-09-27 10:06:34 +08:00
|
|
|
} else if (a.key === 'button') {
|
|
|
|
return 'bottom';
|
2016-03-03 17:23:08 +08:00
|
|
|
}
|
2017-11-30 21:38:48 +08:00
|
|
|
return 'right';
|
2016-09-27 10:06:34 +08:00
|
|
|
}
|
2016-03-03 17:23:08 +08:00
|
|
|
|
2017-11-30 21:38:48 +08:00
|
|
|
export default function Banner({ location }) {
|
2016-12-09 13:02:16 +08:00
|
|
|
const isZhCN = utils.isZhCN(location.pathname);
|
2016-09-27 10:06:34 +08:00
|
|
|
return (
|
2016-11-21 17:48:39 +08:00
|
|
|
<section className="page banner-wrapper">
|
2017-03-27 14:03:28 +08:00
|
|
|
<ScrollElement
|
2017-05-15 12:03:02 +08:00
|
|
|
className="page"
|
|
|
|
id="banner"
|
2017-03-27 14:03:28 +08:00
|
|
|
playScale={0.9}
|
|
|
|
>
|
2016-11-09 19:55:14 +08:00
|
|
|
<QueueAnim className="banner-text-wrapper" type={typeFunc} delay={300} key="banner">
|
2016-09-27 10:06:34 +08:00
|
|
|
<h2 key="h2">ANT <p>DESIGN</p></h2>
|
|
|
|
<p key="content"><FormattedMessage id="app.home.slogan" /></p>
|
|
|
|
<span className="line" key="line" />
|
2017-11-30 21:38:48 +08:00
|
|
|
<div key="button1" className="start-button">
|
2017-12-03 18:09:34 +08:00
|
|
|
<Link to={utils.getLocalizedPathname('/docs/spec/introduce', isZhCN)}>
|
|
|
|
<Button type="primary" size="large">
|
2017-11-30 21:38:48 +08:00
|
|
|
<FormattedMessage id="app.home.introduce" />
|
2017-12-03 18:09:34 +08:00
|
|
|
</Button>
|
|
|
|
</Link>
|
|
|
|
<Link to={utils.getLocalizedPathname('/docs/react/introduce', isZhCN)}>
|
|
|
|
<Button type="primary" ghost size="large">
|
2017-11-30 21:38:48 +08:00
|
|
|
<FormattedMessage id="app.home.start" />
|
2017-12-03 18:09:34 +08:00
|
|
|
</Button>
|
|
|
|
</Link>
|
2016-09-27 10:06:34 +08:00
|
|
|
</div>
|
2017-05-15 12:03:02 +08:00
|
|
|
<GitHubButton
|
|
|
|
key="github-button"
|
|
|
|
type="stargazers"
|
|
|
|
namespace="ant-design"
|
|
|
|
repo="ant-design"
|
2016-09-27 10:06:34 +08:00
|
|
|
/>
|
|
|
|
</QueueAnim>
|
|
|
|
<Icon type="down" className="down" />
|
2016-11-11 17:56:05 +08:00
|
|
|
</ScrollElement>
|
2016-09-27 10:06:34 +08:00
|
|
|
</section>
|
|
|
|
);
|
2016-03-03 17:23:08 +08:00
|
|
|
}
|