Skip to content

Commit

Permalink
AP-85 Integrate ant design into storybook preview
Browse files Browse the repository at this point in the history
  • Loading branch information
vin0401 committed Jan 24, 2024
1 parent d39aad8 commit 5edbfde
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { StorybookConfig } from "@storybook/react-webpack5";
import path from "path";

const config: StorybookConfig = {
stories: ["../assets/js/**/*.mdx", "../assets/js/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
Expand All @@ -18,6 +19,6 @@ const config: StorybookConfig = {
},
docs: {
autodocs: "tag",
},
}
};
export default config;
10 changes: 10 additions & 0 deletions .storybook/preview.ts → .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from "react";
import type { Preview } from "@storybook/react";
import { ThemeProvider } from "../assets/js/modules/theme/components/ThemeProvider"

const preview: Preview = {
parameters: {
Expand All @@ -10,6 +12,14 @@ const preview: Preview = {
},
},
},

decorators: [
(Story) => (
<ThemeProvider>
<Story />
</ThemeProvider>
),
],
};

export default preview;
9 changes: 7 additions & 2 deletions assets/js/components/example/example.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ import { Meta } from '@storybook/react';
import { Example as ExampleComponent } from './example';

export default {
title: 'Pimcore studio/Example',
title: 'Pimcore studio/UI/Example',
component: ExampleComponent,
parameters: {
layout: 'centered'
},
tags: ['autodocs']
} as Meta;

export const _default = {}
export const _default = {
args: {
value: 'Save',
prefix: 'Unsaved changes!! '
}
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"module": "es6",
"moduleResolution": "node",
"baseUrl": "./assets/js",
"baseUrl": "./assets/js/",
"paths": {
"@Pimcore/*": ["./*"]
},
Expand Down

0 comments on commit 5edbfde

Please sign in to comment.