mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-22 18:42:48 +03:00
fix: list page storybook not rendering issue (#4560)
This commit is contained in:
parent
59a4b3bc31
commit
d9fe3e73d5
@ -6,10 +6,12 @@ import {
|
|||||||
PageList,
|
PageList,
|
||||||
PageListTrashView,
|
PageListTrashView,
|
||||||
} from '@affine/component/page-list';
|
} from '@affine/component/page-list';
|
||||||
|
import type { Collection } from '@affine/env/filter';
|
||||||
import { PageIcon } from '@blocksuite/icons';
|
import { PageIcon } from '@blocksuite/icons';
|
||||||
import { expect } from '@storybook/jest';
|
import { expect } from '@storybook/jest';
|
||||||
import type { Meta, StoryFn } from '@storybook/react';
|
import type { Meta, StoryFn } from '@storybook/react';
|
||||||
import { userEvent } from '@storybook/testing-library';
|
import { userEvent } from '@storybook/testing-library';
|
||||||
|
import { atom } from 'jotai';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'AFFiNE/PageList',
|
title: 'AFFiNE/PageList',
|
||||||
@ -61,11 +63,18 @@ export const AffineAllPageList: StoryFn<typeof PageList> = ({ ...props }) => (
|
|||||||
<PageList {...props} />
|
<PageList {...props} />
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const baseAtom = atom<Collection[]>([]);
|
||||||
AffineAllPageList.args = {
|
AffineAllPageList.args = {
|
||||||
isPublicWorkspace: false,
|
isPublicWorkspace: false,
|
||||||
onCreateNewPage: () => toast('Create new page'),
|
onCreateNewPage: () => toast('Create new page'),
|
||||||
onCreateNewEdgeless: () => toast('Create new edgeless'),
|
onCreateNewEdgeless: () => toast('Create new edgeless'),
|
||||||
onImportFile: () => toast('Import file'),
|
onImportFile: () => toast('Import file'),
|
||||||
|
collectionsAtom: atom(
|
||||||
|
get => get(baseAtom),
|
||||||
|
async (_, set, update) => {
|
||||||
|
set(baseAtom, update);
|
||||||
|
}
|
||||||
|
),
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
pageId: '1',
|
pageId: '1',
|
||||||
|
Loading…
Reference in New Issue
Block a user