mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-25 11:52:10 +00:00
Try more blocks
This commit is contained in:
@@ -6,7 +6,7 @@ import { DocumentBlockExpandable } from '@gitbook/api';
|
||||
import { Inlines } from '../Inlines';
|
||||
|
||||
export function Expandable(props: BlockProps<DocumentBlockExpandable>) {
|
||||
const { block, style, context } = props;
|
||||
const { block, style, ancestorBlocks, context } = props;
|
||||
|
||||
const title = getNodeFragmentByType(block, 'expandable-title');
|
||||
const body = getNodeFragmentByType(block, 'expandable-body');
|
||||
@@ -16,7 +16,12 @@ export function Expandable(props: BlockProps<DocumentBlockExpandable>) {
|
||||
<summary className={tcls('cursor-pointer', 'px-4', 'py-3')}>
|
||||
<Inlines nodes={title.nodes[0].nodes} context={context} />
|
||||
</summary>
|
||||
<Blocks nodes={body.nodes} context={context} style={['px-5', 'py-3']} />
|
||||
<Blocks
|
||||
nodes={body.nodes}
|
||||
ancestorBlocks={[...ancestorBlocks, block]}
|
||||
context={context}
|
||||
style={['px-5', 'py-3']}
|
||||
/>
|
||||
</details>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user