mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-04 19:11:57 +08:00
Merge branch 'master' of github.com:toeverything/AFFINE-pathfinder into feat/layout
# Conflicts: # src/pages/index.tsx
This commit is contained in:
@@ -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;
|
||||
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user