Skip to content

Commit

Permalink
apply classes to ul and ol
Browse files Browse the repository at this point in the history
  • Loading branch information
juliuxu committed Aug 8, 2023
1 parent 602e4ec commit e2e2ae5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions packages/notion-render/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @julianjark/notion-render

## 0.9.0

### Minor Changes

- apply classes to ul and ol

## 0.8.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/notion-render/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@julianjark/notion-render",
"version": "0.8.0",
"version": "0.9.0",
"description": "React renderer for the official Notion API",
"author": "Julian Jark",
"license": "ISC",
Expand Down
7 changes: 4 additions & 3 deletions packages/notion-render/src/pseudo-components.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BlockObjectResponse } from "@notionhq/client/build/src/api-endpoints";
import type { BlockObjectResponse } from "@notionhq/client/build/src/api-endpoints";
import type { BlockComponentProps } from "./components";
import { DefaultComponents } from "./components";
import { useNotionRenderContext as ctx } from "./context";

// Pseudo blocks
export interface ListBlock {
Expand All @@ -14,7 +15,7 @@ export type ListBlockType = ListBlock["type"];
export const BulletedList = ({ block }: BlockComponentProps) => {
if (block.type !== "bulleted_list") return null;
return (
<ul>
<ul className={ctx().classes.bulleted_list.root}>
{block.children.map((block) => {
const Component = DefaultComponents[block.type];
if (Component === undefined) return undefined;
Expand All @@ -26,7 +27,7 @@ export const BulletedList = ({ block }: BlockComponentProps) => {
export const NumberedList = ({ block }: BlockComponentProps) => {
if (block.type !== "numbered_list") return null;
return (
<ol>
<ol className={ctx().classes.numbered_list.root}>
{block.children.map((block) => {
const Component = DefaultComponents[block.type];
if (Component === undefined) return undefined;
Expand Down

0 comments on commit e2e2ae5

Please sign in to comment.