summaryrefslogtreecommitdiff
path: root/util/uniorg.tsx
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-11-13 01:32:10 +0100
committerGitHub <[email protected]>2021-11-13 01:32:10 +0100
commit5b6eb504587df592e42690743bce4b41d4066d00 (patch)
treef894e6997c9e0398d1ce13bb56e1964dcf129752 /util/uniorg.tsx
parente214bc388e545cf695e97a3a2e714d5dbb5f25c1 (diff)
Feat: Markdown file previewing (#152)
* feat(md): initial support for md-roam * feat(md): link support and more for md * fix(md): add missing remark math package
Diffstat (limited to 'util/uniorg.tsx')
-rw-r--r--util/uniorg.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/util/uniorg.tsx b/util/uniorg.tsx
index d0251c0..7ffd3b8 100644
--- a/util/uniorg.tsx
+++ b/util/uniorg.tsx
@@ -1,6 +1,6 @@
import React, { useEffect, useMemo, useState } from 'react'
-import { OrgRoamNode } from '../api'
-import { NodeByCite, NodeById } from '../pages/index'
+import { OrgRoamLink, OrgRoamNode } from '../api'
+import { LinksByNodeId, NodeByCite, NodeById } from '../pages/index'
import { ProcessedOrg } from './processOrg'
export interface UniOrgProps {
@@ -12,6 +12,7 @@ export interface UniOrgProps {
openContextMenu: any
outline: boolean
collapse: boolean
+ linksByNodeId: LinksByNodeId
}
export const UniOrg = (props: UniOrgProps) => {
@@ -24,6 +25,7 @@ export const UniOrg = (props: UniOrgProps) => {
setPreviewNode,
outline,
collapse,
+ linksByNodeId,
} = props
const [previewText, setPreviewText] = useState('')
@@ -52,7 +54,7 @@ export const UniOrg = (props: UniOrgProps) => {
return (
<>
- {previewNode?.id && (
+ {previewText && previewNode && (
<ProcessedOrg
{...{
nodeById,
@@ -64,6 +66,7 @@ export const UniOrg = (props: UniOrgProps) => {
openContextMenu,
outline,
collapse,
+ linksByNodeId,
}}
/>
)}