Skip to content

Commit 01e4106

Browse files
committed
fix: article에 theme name add
1 parent 10a5444 commit 01e4106

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

apps/storybook/.storybook/preview.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
import type { Preview } from "@storybook/react";
2-
import { Decorator } from "@storybook/react";
1+
import type { Preview } from '@storybook/react';
32
// 중요: CSS 파일을 직접 가져옵니다
43
import 'notion-to-jsx/dist/index.css';
54

6-
// 모든 스토리에 테마 클래스를 글로벌하게 적용하는 데코레이터 추가
7-
const withTheme: Decorator = (StoryFn, context) => {
8-
const story = StoryFn(context);
9-
// DOM에 직접 테마 클래스 추가
10-
document.body.classList.add('theme_lightTheme__sq3jkbt');
11-
return story;
12-
};
13-
145
const preview: Preview = {
156
parameters: {
167
controls: {
@@ -20,7 +11,6 @@ const preview: Preview = {
2011
},
2112
},
2213
},
23-
decorators: [withTheme],
2414
};
2515

2616
export default preview;

packages/notion-to-jsx/src/components/Renderer/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,12 @@ export const Renderer: React.FC<Props> = React.memo(
132132
}, [blocks, handleBlockFocus]);
133133

134134
return (
135-
<div className={container} role="main" aria-label="Notion page content">
135+
<article
136+
className={`${theme} ${container}`}
137+
aria-label="Notion page content"
138+
>
136139
{renderedBlocks}
137-
</div>
140+
</article>
138141
);
139142
}
140143
);

0 commit comments

Comments
 (0)