Skip to content

Commit

Permalink
feat(spinning): Update the style of loading
Browse files Browse the repository at this point in the history
  • Loading branch information
laoluo committed Aug 14, 2023
1 parent 705bc50 commit 6e93c21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/lb-components/src/views/MainView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import PreviewResult from '@/components/predictTracking/previewResult';
import { LabelBeeContext } from '@/store/ctx';
import { EToolName } from '@/data/enums/ToolType';
import LLMLayout from './LLMLayout';
import { LoadingOutlined } from '@ant-design/icons';
import { useTranslation } from 'react-i18next';

interface IProps {
path: string;
Expand Down Expand Up @@ -74,11 +76,17 @@ const AnnotatedArea: React.FC<AppProps & IProps> = (props) => {
};

const ViewportProviderLayout = (props: AppProps & IProps & { children: any }) => {
const { t } = useTranslation();
const { stepList, step } = props;
const currentToolName = getStepConfig(stepList, step)?.tool;
return (
<ViewportProvider>
<Spin spinning={props.loading}>
<Spin
spinning={props.loading}
indicator={<LoadingOutlined />}
tip={<span style={{ marginTop: 200 }}>{t('LoadingTips')}</span>}
delay={500}
>
<Layout className={classnames([layoutCls, props.className])} style={props.style?.layout}>
<header className={`${layoutCls}__header`} style={props.style?.header}>
<ToolHeader
Expand Down
2 changes: 2 additions & 0 deletions packages/lb-utils/src/i18n/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
"DefaultSize":"Click to use the default size.",
"NormalSizeRange":"Normal size range",
"NormalCenterPointRange":"Normal center point range",
"LoadingTips": "Wait a minute, Data Loading ~",
"Unlocked":"Unlocked",
"Locked":"Locked"
},
Expand Down Expand Up @@ -494,6 +495,7 @@
"DefaultSize":"点击图标以使用默认尺寸",
"NormalSizeRange":"正常尺寸范围",
"NormalCenterPointRange":"正常中心点范围",
"LoadingTips": "数据加载中~请稍后",
"Unlocked":"未开启",
"Locked":"已开启"
}
Expand Down

0 comments on commit 6e93c21

Please sign in to comment.