Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

add loding style

DiamondThreefc1377bcfb49
diff --git a/libs/components/editor-blocks/src/components/source-view/SourceView.tsx b/libs/components/editor-blocks/src/components/source-view/SourceView.tsx
index 9b5c813679..f8264e8f18 100644
--- a/libs/components/editor-blocks/src/components/source-view/SourceView.tsx
+++ b/libs/components/editor-blocks/src/components/source-view/SourceView.tsx
@@ -135,10 +135,27 @@ const LazyIframe = ({
>
<iframe src={src} onLoad={onLoad} />
</div>
+ {show ? '' : fallback}
</>
);
};
+const Loading = styled('div')(() => {
+ return {
+ width: '100%',
+ height: '100%',
+ display: 'flex',
+ lineHeight: '100%',
+ alignItems: 'center',
+ justifyContent: 'center',
+ border: '1px solid #EAEEF2',
+ };
+});
+
+const LoadingContiner = () => {
+ return <Loading>loading...</Loading>;
+};
+
export const SourceView: FC<Props> = props => {
const { link, isSelected, block, editorElement } = props;
const src = formatUrl(link);
@@ -151,7 +168,10 @@ export const SourceView: FC<Props> = props => {
<SourceViewContainer isSelected={isSelected} scene={type}>
<MouseMaskContainer />
- <LazyIframe src={src} fallback={'Loading……'}></LazyIframe>
+ <LazyIframe
+ src={src}
+ fallback={LoadingContiner()}
+ ></LazyIframe>
</SourceViewContainer>
</div>
);