Skip to content

Commit 2bb4178

Browse files
committed
legg tilbake LenkeBase-story
1 parent a588478 commit 2bb4178

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react';
2+
import { Meta, StoryObj } from '@storybook/react';
3+
import { PageContextProvider } from 'store/pageContext';
4+
import { adminPreviewUrlPrefix, LenkeBase } from './LenkeBase';
5+
6+
const withMockedPageContent = (Story: any) => (
7+
<PageContextProvider content={{ editorView: 'edit' }}>
8+
<Story />
9+
</PageContextProvider>
10+
);
11+
const meta: Meta<typeof LenkeBase> = {
12+
component: LenkeBase,
13+
decorators: [withMockedPageContent],
14+
};
15+
16+
export default meta;
17+
type Story = StoryObj<typeof LenkeBase>;
18+
19+
export const Default: Story = {
20+
args: {
21+
href: '/',
22+
children: 'Trykk her',
23+
},
24+
};
25+
26+
export const BadLinkWarning: Story = {
27+
args: {
28+
href: adminPreviewUrlPrefix,
29+
children: 'Trykk her',
30+
},
31+
};

0 commit comments

Comments
 (0)