Skip to content

Commit

Permalink
🚴‍♀️ Refactor task-item (#187)
Browse files Browse the repository at this point in the history
Co-authored-by: Angus Hollands <[email protected]>
  • Loading branch information
rowanc1 and agoose77 authored Sep 22, 2023
1 parent 6e1a69a commit dd8f62f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/taskItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import { NodeRenderer } from '@myst-theme/providers';
import type { ListItem } from 'myst-spec-ext';
import { useTaskItemController } from './TaskItemControllerProvider';
import { MyST } from 'myst-to-react';
import { GenericNode } from 'myst-common';

function TaskItem({
checked,
line,
children
}: {
checked?: boolean;
children: GenericNode[];
children: React.ReactNode;
line?: number;
}) {
// The rendering waiting on promises from Jupyter is slow
Expand All @@ -32,7 +31,7 @@ function TaskItem({
setLocal(!local);
}}
/>
<MyST ast={children} />
{children}
</li>
);
}
Expand All @@ -53,7 +52,7 @@ export const listItem: NodeRenderer<ListItem & { checked?: boolean }> = ({
checked={node.checked}
line={node.position?.start.line}
>
{node.children}
<MyST ast={node.children} />
</TaskItem>
);
};

0 comments on commit dd8f62f

Please sign in to comment.