docs: Adjust site (#21642)

* redirect when v4 release

* fix lint
This commit is contained in:
二货机器人 2020-02-27 17:11:29 +08:00 committed by GitHub
parent 12761e8382
commit de0d609c02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 4 deletions

View File

@ -40,9 +40,11 @@
font-weight: normal;
text-align: center;
.anticon {
img {
display: inline-block;
width: 18px;
margin-right: 8px;
vertical-align: text-bottom;
}
}

View File

@ -2,7 +2,7 @@ import * as React from 'react';
import { Button, Popover } from 'antd';
import { Link } from 'bisheng/router';
import { FormattedMessage, useIntl } from 'react-intl';
import { PlayCircleFilled, MobileFilled } from '@ant-design/icons';
import { PlayCircleFilled } from '@ant-design/icons';
import Background from './Background';
import { getLocalizedPathname } from '../../utils';
import Logo from './Logo';
@ -19,7 +19,11 @@ export default function Banner() {
if (isMobile) {
qrNode = (
<a href="http://antd4.antfin.com/">
<MobileFilled /> <FormattedMessage id="app.home.qr" />
<img
alt="mobile"
src="https://gw.alipayobjects.com/zos/basement_prod/d2fa63a8-3e9d-4f59-80c7-1fd1d0cd9118.svg"
/>
<FormattedMessage id="app.home.qr" />
</a>
);
} else {
@ -40,7 +44,11 @@ export default function Banner() {
}
>
<a>
<MobileFilled /> <FormattedMessage id="app.home.qr" />
<img
alt="mobile"
src="https://gw.alipayobjects.com/zos/basement_prod/d2fa63a8-3e9d-4f59-80c7-1fd1d0cd9118.svg"
/>
<FormattedMessage id="app.home.qr" />
</a>
</Popover>
);

View File

@ -25,6 +25,11 @@ if (typeof window !== 'undefined' && navigator.serviceWorker) {
}
if (typeof window !== 'undefined') {
// Redirect to `ant.design` if is not next version anymore
if (antdReproduceVersion === 'latest' && location.hostname === 'next.ant.design') {
location.href = location.href.replace('next.ant.design', 'ant.design');
}
// eslint-disable-next-line global-require
require('../../static/style');