(props: RenderTreeProps)
| 47 | onBlankSpacePress: () => void |
| 48 | } |
| 49 | function RenderTree(props: RenderTreeProps) { |
| 50 | const { |
| 51 | onBlankSpacePress |
| 52 | } = props; |
| 53 | const { blockTypes, defaultBlockType } = useBlockRegistrationContext(); |
| 54 | const { blocks, blocksOrder } = useBlocksContext(); |
| 55 | |
| 56 | return ( |
| 57 | <> |
| 58 | {/* We concat the "root" content (should be just one item) with the content of its only child. */} |
| 59 | {blocksOrder.map((blockId: string, index: number) => { |
| 60 | const Component = blockTypes[blocks[blockId].type].component; |
| 61 | return ( |
| 62 | <LayoutProvider blockId={blockId} key={`block-${blockId}`}> |
| 63 | <View style={{ backgroundColor: "transparent" }}> |
| 64 | <Component blockId={blockId} /> |
| 65 | </View> |
| 66 | </LayoutProvider> |
| 67 | ) |
| 68 | })} |
| 69 | |
| 70 | <BlankSpace onBlankSpacePress={onBlankSpacePress}/> |
| 71 | </> |
| 72 | ) |
| 73 | } |
| 74 | |
| 75 | interface EditorProps { |
| 76 | children: React.ReactNode |
nothing calls this directly
no test coverage detected