generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DebugComponent.stories.tsx
75 lines (67 loc) · 1.64 KB
/
DebugComponent.stories.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import type {Meta} from '@storybook/react';
import {StoryObj} from "@storybook/react";
import {ContentfulDebugComponent} from "../components/ContentfulDebugComponent";
import {withEntryArgMutator} from "../withEntryArgMutator";
const meta = {
title: 'ContentfulPreview/Debug',
component: ContentfulDebugComponent,
} satisfies Meta<typeof ContentfulDebugComponent>;
type Story = StoryObj<typeof ContentfulDebugComponent>;
/*
* render static data (if parameter `contentfulPreview` is not set),
*/
export const Static: Story = {
decorators: [withEntryArgMutator],
args: {
contentful_entry: {
sys: {
id: '5M3xHa49MTRrkhiaascL3Q',
type: 'Entry',
},
fields: {
title: 'Title',
description: 'Description',
}
}
}
}
/*
* Set live preview to get live updates in contentful's preview mode
*/
export const LivePreview: Story = {
parameters: {
contentfulPreview: {
entryId: '5M3xHa49MTRrkhiaascL3Q',
livePreview: true,
}
}
}
/*
* Without live preview, the component will not update when the entry changes
*/
export const NoLivePreview: Story = {
parameters: {
contentfulPreview: {
entryId: '5M3xHa49MTRrkhiaascL3Q',
livePreview: false,
}
}
}
//
// export const StaticLivePreview: Story = {
// decorators: [withArgsMutator, withLivePreview],
// args: {
// entryId: '5M3xHa49MTRrkhiaascL3Q',
// contentful_entry: {
// sys: {
// id: '5M3xHa49MTRrkhiaascL3Q',
// type: 'Entry',
// },
// fields: {
// title: 'Title',
// description: 'Description',
// }
// }
// }
// }
export default meta;