Commit d1c93682 authored by tom's avatar tom

loading screen

parent 7695b174
...@@ -9,6 +9,7 @@ import type { File, Monaco } from './types'; ...@@ -9,6 +9,7 @@ import type { File, Monaco } from './types';
import useClientRect from 'lib/hooks/useClientRect'; import useClientRect from 'lib/hooks/useClientRect';
import CodeEditorBreadcrumbs from './CodeEditorBreadcrumbs'; import CodeEditorBreadcrumbs from './CodeEditorBreadcrumbs';
import CodeEditorLoading from './CodeEditorLoading';
import CodeEditorSideBar from './CodeEditorSideBar'; import CodeEditorSideBar from './CodeEditorSideBar';
import CodeEditorTabs from './CodeEditorTabs'; import CodeEditorTabs from './CodeEditorTabs';
import * as themes from './utils/themes'; import * as themes from './utils/themes';
...@@ -143,6 +144,7 @@ const CodeEditor = ({ data }: Props) => { ...@@ -143,6 +144,7 @@ const CodeEditor = ({ data }: Props) => {
defaultValue={ data[index].source_code } defaultValue={ data[index].source_code }
options={ EDITOR_OPTIONS } options={ EDITOR_OPTIONS }
onMount={ handleEditorDidMount } onMount={ handleEditorDidMount }
loading={ <CodeEditorLoading/> }
/> />
</Box> </Box>
<CodeEditorSideBar data={ data } onFileSelect={ handleSelectFile } monaco={ instance } selectedFile={ data[index].file_path }/> <CodeEditorSideBar data={ data } onFileSelect={ handleSelectFile } monaco={ instance } selectedFile={ data[index].file_path }/>
......
import { Center } from '@chakra-ui/react';
import React from 'react';
import ContentLoader from 'ui/shared/ContentLoader';
import useThemeColors from './utils/useThemeColors';
const CodeEditorLoading = () => {
const themeColors = useThemeColors();
return (
<Center bgColor={ themeColors['editor.background'] } w="100%" h="100%">
<ContentLoader/>
</Center>
);
};
export default React.memo(CodeEditorLoading);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment