ant-design/site/theme/template/Home/Banner.jsx
Benjy Cui 4ee2b9d930 site: SSR for official website (#3903)
* site: ssr for Layout

* site: SSR for site

* fix: ssr for Anchor

* chore: add ssr test

* chore: update deploy script

* site: udpate detail

* site: revert animation for site

* site: fix loading animation
2016-11-21 14:39:15 +08:00

44 lines
1.5 KiB
JavaScript

import React from 'react';
import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
import ScrollElement from 'rc-scroll-anim/lib/ScrollElement';
import GitHubButton from 'react-github-button';
import { Icon } from 'antd';
import QueueAnim from 'rc-queue-anim';
function typeFunc(a) {
if (a.key === 'line') {
return 'right';
} else if (a.key === 'button') {
return 'bottom';
}
return 'left';
}
export default function Banner({ location, onEnterChange }) {
const query = location.query;
return (
<section id="banner" className="page">
<ScrollElement id="banner" onChange={({ mode }) => onEnterChange(mode)}>
<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={{ query, pathname: '/docs/spec/introduce' }}>
<FormattedMessage id="app.home.introduce" />
</Link>
<Link to={{ query, pathname: '/docs/react/introduce' }}>
<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>
);
}