ant-design/.dumi/theme/common/Loading.tsx
MadCcc fab90b09f4
docs: fix site issue (#38552)
* docs: put an example loading component

* fix: site issue

* fix: site issue

* feat: add loading

* feat: alert

* docs: rm ReactDOM.render in md

* docs: use style tag

* chore: update snapshot

* Revert "docs: use style tag"

This reverts commit 1f75a99f8c972dc72f05391b472641245f6d8a17.

* docs: update demo

* chore: update demo

Co-authored-by: PeachScript <scdzwyxst@gmail.com>
2022-11-15 22:55:01 +08:00

29 lines
731 B
TypeScript

import React, { type FC } from 'react';
import { Skeleton, Space, Spin } from 'antd';
import { useLocation } from 'dumi';
const Loading: FC = () => {
const { pathname } = useLocation();
if (
pathname.startsWith('/components') ||
pathname.startsWith('/docs') ||
pathname.startsWith('/changelog')
) {
return (
<Space direction="vertical" style={{ width: '100%' }} size={40}>
<Skeleton title={false} active paragraph={{ rows: 3 }} />
<Skeleton active paragraph={{ rows: 3 }} />
</Space>
);
}
return (
<Space style={{ width: '100%', margin: '120px 0', justifyContent: 'center' }} align="center">
<Spin size="large" />
</Space>
);
};
export default Loading;