Browse Source

chore: update mirror host (#38674)

* chore: update host

* chore: rm gitee mirror

* chore: lint

* chore: ignore crop-imgae
pull/38833/head
MadCcc 2 years ago
committed by GitHub
parent
commit
d3a7119d03
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/upload/__tests__/demo-extend.test.ts
  2. 2
      components/upload/__tests__/demo.test.ts
  3. 2
      components/upload/__tests__/image.test.ts
  4. 37
      site/theme/template/Layout/Header/Navigation.tsx
  5. 8
      site/theme/template/Layout/index.tsx

2
components/upload/__tests__/demo-extend.test.ts

@ -1,3 +1,3 @@
import { extendTest } from '../../../tests/shared/demoTest';
extendTest('upload');
extendTest('upload', { skip: ['crop-image.md'] });

2
components/upload/__tests__/demo.test.ts

@ -1,3 +1,3 @@
import demoTest from '../../../tests/shared/demoTest';
demoTest('upload');
demoTest('upload', { skip: ['crop-image.md'] });

2
components/upload/__tests__/image.test.ts

@ -1,5 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('Upload image', () => {
imageDemoTest('upload');
imageDemoTest('upload', { skip: ['crop-image.md'] });
});

37
site/theme/template/Layout/Header/Navigation.tsx

@ -126,39 +126,14 @@ export default ({
key: 'tech-ui',
}
: null,
isZhCN &&
typeof window !== 'undefined' &&
window.location.host !== 'ant-design.antgroup.com' &&
window.location.host !== 'ant-design.gitee.io'
isZhCN && typeof window !== 'undefined' && window.location.host !== '4x-ant-design.antgroup.com'
? {
label: '国内镜像',
label: (
<a href="https://4x-ant-design.antgroup.com" target="__blank" rel="noopener noreferrer">
</a>
),
key: 'mirror',
children: [
{
label: <a href="https://ant-design.antgroup.com"></a>,
icon: (
<img
alt="logo"
src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
width={16}
style={{ verticalAlign: 'text-bottom' }}
/>
),
key: 'antgroup',
},
{
label: <a href="https://ant-design.gitee.io">Gitee </a>,
icon: (
<img
alt="gitee"
src="https://gw.alipayobjects.com/zos/bmw-prod/9e91e124-9bab-4113-b500-301412f6b370.svg"
width={16}
style={{ verticalAlign: 'text-bottom' }}
/>
),
key: 'gitee',
},
],
}
: null,
...(additional ?? []),

8
site/theme/template/Layout/index.tsx

@ -10,7 +10,7 @@ import { setTwoToneColor } from '@ant-design/icons';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import { ConfigProvider } from 'antd';
import { browserHistory } from 'bisheng/router';
import zhCN from 'antd/lib/locale/zh_CN';
import zhCN from 'antd/es/locale/zh_CN';
import type { DirectionType } from 'antd/es/config-provider';
import Header from './Header';
import type { SiteContextProps } from './SiteContext';
@ -21,8 +21,8 @@ import * as utils from '../utils';
import 'moment/locale/zh-cn';
if (typeof window !== 'undefined' && navigator.serviceWorker) {
navigator.serviceWorker.getRegistrations().then(registrations => {
registrations.forEach(registration => registration.unregister());
navigator.serviceWorker.getRegistrations().then((registrations) => {
registrations.forEach((registration) => registration.unregister());
});
}
@ -44,7 +44,7 @@ if (typeof window !== 'undefined') {
(window as any)['@ant-design/icons'] = require('@ant-design/icons');
// Error log statistic
window.addEventListener('error', e => {
window.addEventListener('error', (e) => {
// Ignore ResizeObserver error
if (e.message === 'ResizeObserver loop limit exceeded') {
e.stopPropagation();

Loading…
Cancel
Save