ant-design/site/theme/template/Home/Banner.jsx

49 lines
1.6 KiB
React
Raw Normal View History

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';
import { FormattedMessage } from 'react-intl';
import ScrollElement from 'rc-scroll-anim/lib/ScrollElement';
2016-03-14 15:00:11 +08:00
import GitHubButton from 'react-github-button';
2016-04-11 10:12:48 +08:00
import { Icon } from 'antd';
2016-03-30 19:14:09 +08:00
import QueueAnim from 'rc-queue-anim';
import * as utils from '../utils';
2016-03-03 17:23:08 +08:00
function typeFunc(a) {
if (a.key === 'line') {
return 'right';
} else if (a.key === 'button') {
return 'bottom';
2016-03-03 17:23:08 +08:00
}
return 'left';
}
2016-03-03 17:23:08 +08:00
export default function Banner({ location, onEnterChange }) {
const isZhCN = utils.isZhCN(location.pathname);
return (
2016-11-21 17:48:39 +08:00
<section className="page banner-wrapper">
<ScrollElement
className="page" id="banner"
onChange={({ mode }) => onEnterChange(mode)}
playScale={0.9}
>
<QueueAnim className="banner-text-wrapper" type={typeFunc} delay={300} key="banner">
<h2 key="h2">ANT <p>DESIGN</p></h2>
<p key="content"><FormattedMessage id="app.home.slogan" /></p>
<span className="line" key="line" />
<div key="button1" className="start-button clearfix">
<Link to={utils.getLocalizedPathname('/docs/spec/introduce', isZhCN)}>
<FormattedMessage id="app.home.introduce" />
</Link>
<Link to={utils.getLocalizedPathname('/docs/react/introduce', isZhCN)}>
<FormattedMessage id="app.home.start" />
</Link>
</div>
<GitHubButton key="github-button" type="stargazers"
namespace="ant-design" repo="ant-design"
/>
</QueueAnim>
<Icon type="down" className="down" />
</ScrollElement>
</section>
);
2016-03-03 17:23:08 +08:00
}