mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-22 09:13:18 +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,
|
||||
PageListTrashView,
|
||||
} from '@affine/component/page-list';
|
||||
import type { Collection } from '@affine/env/filter';
|
||||
import { PageIcon } from '@blocksuite/icons';
|
||||
import { expect } from '@storybook/jest';
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
import { userEvent } from '@storybook/testing-library';
|
||||
import { atom } from 'jotai';
|
||||
|
||||
export default {
|
||||
title: 'AFFiNE/PageList',
|
||||
@ -61,11 +63,18 @@ export const AffineAllPageList: StoryFn<typeof PageList> = ({ ...props }) => (
|
||||
<PageList {...props} />
|
||||
);
|
||||
|
||||
const baseAtom = atom<Collection[]>([]);
|
||||
AffineAllPageList.args = {
|
||||
isPublicWorkspace: false,
|
||||
onCreateNewPage: () => toast('Create new page'),
|
||||
onCreateNewEdgeless: () => toast('Create new edgeless'),
|
||||
onImportFile: () => toast('Import file'),
|
||||
collectionsAtom: atom(
|
||||
get => get(baseAtom),
|
||||
async (_, set, update) => {
|
||||
set(baseAtom, update);
|
||||
}
|
||||
),
|
||||
list: [
|
||||
{
|
||||
pageId: '1',
|
||||
|
Loading…
Reference in New Issue
Block a user