Merge branch 'feat/cloud-sync-saika' into feat/datacenter-dev

This commit is contained in:
DiamondThree
2023-01-11 20:45:58 +08:00
9 changed files with 208 additions and 20 deletions
@@ -3,6 +3,7 @@ import { useAppState } from '@/providers/app-state-provider';
import type { NextPageWithLayout } from '../..//_app';
import dynamic from 'next/dynamic';
import { useRouter } from 'next/router';
const DynamicBlocksuite = dynamic(() => import('@/components/editor'), {
ssr: false,
});
@@ -11,7 +12,14 @@ const Page: NextPageWithLayout = () => {
const [page, setPage] = useState(null);
const { dataCenter } = useAppState();
console.log('dataCenter: ', dataCenter);
const router = useRouter();
console.log(router.query.workspaceId);
dataCenter
.loadPublicWorkspace(router.query.workspaceId as string)
.then(data => {
console.log(data);
});
return (
<>
{workspace && page && (
@@ -4,12 +4,21 @@ import { PageListHeader } from '@/components/header';
import { ReactElement } from 'react';
import { useTranslation } from '@affine/i18n';
import { useAppState } from '@/providers/app-state-provider';
import { useRouter } from 'next/router';
const All = () => {
const { pageList } = useAppState();
const { t } = useTranslation();
const { dataCenter } = useAppState();
const router = useRouter();
console.log(router.query.workspaceId);
dataCenter
.loadPublicWorkspace(router.query.workspaceId as string)
.then(data => {
console.log(data);
});
return (
<>
<PageListHeader icon={<AllPagesIcon />}>{t('All pages')}</PageListHeader>
<PageList
pageList={pageList.filter(p => !p.trash)}
showFavoriteTag={true}