Skip to content

Commit e2e2ae5

Browse files
committed
apply classes to ul and ol
1 parent 602e4ec commit e2e2ae5

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

packages/notion-render/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @julianjark/notion-render
22

3+
## 0.9.0
4+
5+
### Minor Changes
6+
7+
- apply classes to ul and ol
8+
39
## 0.8.0
410

511
### Minor Changes

packages/notion-render/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@julianjark/notion-render",
3-
"version": "0.8.0",
3+
"version": "0.9.0",
44
"description": "React renderer for the official Notion API",
55
"author": "Julian Jark",
66
"license": "ISC",

packages/notion-render/src/pseudo-components.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { BlockObjectResponse } from "@notionhq/client/build/src/api-endpoints";
1+
import type { BlockObjectResponse } from "@notionhq/client/build/src/api-endpoints";
22
import type { BlockComponentProps } from "./components";
33
import { DefaultComponents } from "./components";
4+
import { useNotionRenderContext as ctx } from "./context";
45

56
// Pseudo blocks
67
export interface ListBlock {
@@ -14,7 +15,7 @@ export type ListBlockType = ListBlock["type"];
1415
export const BulletedList = ({ block }: BlockComponentProps) => {
1516
if (block.type !== "bulleted_list") return null;
1617
return (
17-
<ul>
18+
<ul className={ctx().classes.bulleted_list.root}>
1819
{block.children.map((block) => {
1920
const Component = DefaultComponents[block.type];
2021
if (Component === undefined) return undefined;
@@ -26,7 +27,7 @@ export const BulletedList = ({ block }: BlockComponentProps) => {
2627
export const NumberedList = ({ block }: BlockComponentProps) => {
2728
if (block.type !== "numbered_list") return null;
2829
return (
29-
<ol>
30+
<ol className={ctx().classes.numbered_list.root}>
3031
{block.children.map((block) => {
3132
const Component = DefaultComponents[block.type];
3233
if (Component === undefined) return undefined;

0 commit comments

Comments
 (0)