Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX]: codeblock component was printing code to screen.. weird #88

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/components/CodeBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const CodeBlock = ({
</code>
</pre>
<P styleProps={["italic"]}>{caption}</P>
<div>{code}</div>
</div>
);
};
Expand Down
6 changes: 3 additions & 3 deletions app/routes/braindumps.list.$braindumpId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ type LoaderData = {
};

export const loader: LoaderFunction = async ({ params }) => {

/* 1. retrieve the Notion Page equivalent of this Braindump */
const response: Page = await notionClient.pages.retrieve({
page_id: params.braindumpId,
Expand Down Expand Up @@ -306,12 +305,13 @@ const useNotionInterpretBlocks = (
return null;

case "code":
// todo: throw an error if a code block is missing a caption
return (
<CodeBlock
key={block.id}
content={{
caption: block.code.caption[0].plain_text,
...(block.code.caption[0] && {
caption: block.code.caption[0].plain_text,
}),
code: block.code.rich_text[0].plain_text,
}}
/>
Expand Down