mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-29 13:47:02 +08:00
abf215a982
* init recommend block * init design pages * home frames * add background banner * hello, Hitu makes the animation * add media query * add images * update types * add declare * preload support * update ignore * additional ignore site Home lint * update ignore * add hover effect * adjust alt of bannber * adjust lang & card shadow * fix typo * adjust desc * hitu in english * article add link * Certainty is hitu * Meaning Hitu * Growth with Hitu * Natural Hitu * slow down of Natural * adjust speed of icons * New Meaning animation * adjust animation duration * update card link * update link * values doc * replace images * faster Growth * update values * fix lint * all slow down * adjust padding * update icons * adjust margin * update images * adjust montion * adjust by designer * update pages * update design prod * update articles * update site style * update doc * update images * update style * lint fix * adjust liner color * github text color update * adjust margin of title * mobile design * update design sub card * update style * less lint * update images * design card auto height * update img * update logo transition * adjust card style * adjust style to fix 184 * adjust nav style * category it * slow down of logo * update style * hide video link * hitu article * use img of hitu * update docs * style lint * update Hitu layout doc * update images * speed up logo * update link * clean up * clean up * update doc * adjust doc * update images
79 lines
2.0 KiB
TypeScript
79 lines
2.0 KiB
TypeScript
import * as React from 'react';
|
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
import { Typography } from 'antd';
|
|
import { Link } from 'bisheng/router';
|
|
import Banner from './Banner';
|
|
import RecommendPage from './RecommendPage';
|
|
import DesignPage from './DesignPage';
|
|
import MorePage from './MorePage';
|
|
import Footer from '../Layout/Footer';
|
|
import { getLocalizedPathname } from '../utils';
|
|
import './index.less';
|
|
|
|
const { Title } = Typography;
|
|
|
|
function getStyle() {
|
|
return `
|
|
.rc-footer-container {
|
|
padding-left: 0;
|
|
padding-right: 0;
|
|
}
|
|
|
|
.rc-footer-columns {
|
|
max-width: 1208px;
|
|
margin: 0 auto;
|
|
}
|
|
`;
|
|
}
|
|
|
|
interface BlockContentProps {
|
|
title: React.ReactNode;
|
|
extra?: React.ReactNode;
|
|
}
|
|
|
|
const BlockContent: React.FC<BlockContentProps> = ({ title, children, extra }) => (
|
|
<div className="home-block-content">
|
|
<Title level={2} style={{ fontWeight: 'lighter', color: '#314659' }}>
|
|
{title}
|
|
|
|
{extra && (
|
|
<div style={{ float: 'right', fontSize: 16, fontWeight: 200, paddingTop: 12 }}>{extra}</div>
|
|
)}
|
|
</Title>
|
|
{children}
|
|
</div>
|
|
);
|
|
|
|
export default function Home() {
|
|
const { locale } = useIntl();
|
|
const isZhCN = locale === 'zh-CN';
|
|
|
|
return (
|
|
<div className="home-container">
|
|
<style dangerouslySetInnerHTML={{ __html: getStyle() }} /> {/* eslint-disable-line */}
|
|
<Banner />
|
|
<div style={{ maxWidth: 1256, margin: '0 auto' }}>
|
|
<BlockContent title={<FormattedMessage id="app.home.recommend" />}>
|
|
<RecommendPage />
|
|
</BlockContent>
|
|
|
|
<BlockContent title={<FormattedMessage id="app.home.design-and-framework" />}>
|
|
<DesignPage />
|
|
</BlockContent>
|
|
|
|
<BlockContent
|
|
title={<FormattedMessage id="app.home.more" />}
|
|
extra={
|
|
<Link to={getLocalizedPathname('/docs/spec/article', isZhCN)}>
|
|
<FormattedMessage id="app.home.view-more" />
|
|
</Link>
|
|
}
|
|
>
|
|
<MorePage />
|
|
</BlockContent>
|
|
</div>
|
|
<Footer />
|
|
</div>
|
|
);
|
|
}
|