Merge branch 'master' of github.com:toeverything/AFFINE-pathfinder into feat/layout

# Conflicts:
#	src/pages/index.tsx
This commit is contained in:
QiShaoXuan
2022-10-12 13:56:53 +08:00
5 changed files with 309 additions and 15 deletions
+28
View File
@@ -0,0 +1,28 @@
import type { EditorContainer } from '@blocksuite/editor';
import '@blocksuite/blocks';
import '@blocksuite/editor';
import '@blocksuite/blocks/style';
export const Editor = () => {
return (
<div>
Editor
<editor-container />
</div>
);
};
declare global {
interface HTMLElementTagNameMap {
'editor-container': EditorContainer;
}
namespace JSX {
interface IntrinsicElements {
// TODO fix type error
'editor-container': any; // EditorContainer
}
}
}
export default Editor;
+31
View File
@@ -1,4 +1,5 @@
import type { NextPage } from 'next';
import dynamic from 'next/dynamic';
import { styled, useTheme } from '@/styles';
import { Header } from '@/components/Header';
@@ -11,12 +12,42 @@ const StyledEditorContainer = styled('div')(({ theme }) => {
};
});
const DynamicEditor = dynamic(() => import('../components/editor'), {
loading: () => <div>Loading...</div>,
ssr: false,
});
const Home: NextPage = () => {
const { changeMode, mode } = useTheme();
return (
<div>
<Header />
<StyledEditorContainer></StyledEditorContainer>
{/*<Button>A button use the theme styles</Button>*/}
{/*<simple-counter name="A counter created by web component" />*/}
{/*<p>current mode {mode}</p>*/}
{/*<button*/}
{/* onClick={() => {*/}
{/* changeMode('light');*/}
{/* }}*/}
{/*>*/}
{/* light*/}
{/*</button>*/}
{/*<button*/}
{/* onClick={() => {*/}
{/* changeMode('dark');*/}
{/* }}*/}
{/*>*/}
{/* dark*/}
{/*</button>*/}
{/*<button*/}
{/* onClick={() => {*/}
{/* changeMode('auto');*/}
{/* }}*/}
{/*>*/}
{/* auto*/}
{/*</button>*/}
<DynamicEditor />
</div>
);
};