Skip to content

Commit

Permalink
馃拕 style: improve loading style
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Dec 29, 2023
1 parent 6f1f983 commit 3a6f581
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';

import { BuiltinToolsRenders } from '@/tools/renders';

Expand All @@ -17,13 +16,7 @@ const BuiltinType = memo<BuiltinTypeProps>(({ content, id, identifier, loading }
const { isJSON, data } = useParseContent(content);

if (!isJSON) {
return (
loading && (
<Flexbox gap={8}>
<Loading />
</Flexbox>
)
);
return loading && <Loading />;
}

const Render = BuiltinToolsRenders[identifier || ''];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Skeleton } from 'antd';
import dynamic from 'next/dynamic';
import { Suspense, memo } from 'react';
import { Flexbox } from 'react-layout-kit';

import { useToolStore } from '@/store/tool';
import { pluginSelectors } from '@/store/tool/selectors';
Expand All @@ -24,13 +23,7 @@ const PluginDefaultType = memo<PluginDefaultTypeProps>(({ content, name, loading
const { isJSON, data } = useParseContent(content);

if (!isJSON) {
return (
loading && (
<Flexbox gap={8}>
<Loading />
</Flexbox>
)
);
return loading && <Loading />;
}

if (!manifest?.ui) return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Markdown } from '@lobehub/ui';
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';

import Loading from '../Loading';

Expand All @@ -10,12 +9,7 @@ export interface PluginMarkdownTypeProps {
}

const PluginMarkdownType = memo<PluginMarkdownTypeProps>(({ content, loading }) => {
if (loading)
return (
<Flexbox gap={8}>
<Loading />
</Flexbox>
);
if (loading) return <Loading />;

return <Markdown>{content}</Markdown>;
});
Expand Down

0 comments on commit 3a6f581

Please sign in to comment.