summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-12-04 13:44:47 +0100
committerGitHub <[email protected]>2021-12-04 13:44:47 +0100
commit0062fc08917e9ee70148105fe5134e9f4dcf9aba (patch)
tree43cae6d205afd8fdf4f9e70e93eeecf50b2bc109 /components
parent4edbd2abae11def87284d6f7a4a2e1fd4e122cd6 (diff)
fix: add org-attach-id-dir support (#153)
Diffstat (limited to 'components')
-rw-r--r--components/Sidebar/Backlinks.tsx5
-rw-r--r--components/Sidebar/Link.tsx6
-rw-r--r--components/Sidebar/Note.tsx5
-rw-r--r--components/Sidebar/index.tsx3
4 files changed, 19 insertions, 0 deletions
diff --git a/components/Sidebar/Backlinks.tsx b/components/Sidebar/Backlinks.tsx
index 892af8c..9bfb1fe 100644
--- a/components/Sidebar/Backlinks.tsx
+++ b/components/Sidebar/Backlinks.tsx
@@ -16,6 +16,8 @@ export interface BacklinksProps {
setSidebarHighlightedNode: OrgRoamNode
openContextMenu: any
outline: boolean
+ attachDir: string
+ macros: { [key: string]: string }
}
import { PreviewLink } from './Link'
@@ -32,6 +34,8 @@ export const Backlinks = (props: BacklinksProps) => {
nodeByCite,
openContextMenu,
outline,
+ macros,
+ attachDir,
} = props
const links = linksByNodeId[previewNode?.id] ?? []
@@ -69,6 +73,7 @@ export const Backlinks = (props: BacklinksProps) => {
openContextMenu={openContextMenu}
outline={outline}
noUnderline
+ {...{ attachDir, macros }}
>
{nodeById[link as string]?.title}
</PreviewLink>
diff --git a/components/Sidebar/Link.tsx b/components/Sidebar/Link.tsx
index c4eea2f..e5b1102 100644
--- a/components/Sidebar/Link.tsx
+++ b/components/Sidebar/Link.tsx
@@ -41,6 +41,8 @@ export interface LinkProps {
linksByNodeId: LinksByNodeId
isWiki?: boolean
noUnderline?: boolean
+ attachDir: string
+ macros: { [key: string]: string }
}
export interface NodeLinkProps {
@@ -138,6 +140,8 @@ export const PreviewLink = (props: LinkProps) => {
noUnderline,
linksByNodeId,
isWiki,
+ macros,
+ attachDir,
} = props
// TODO figure out how to properly type this
// see https://github.com/rehypejs/rehype-react/issues/25
@@ -290,6 +294,8 @@ export const PreviewLink = (props: LinkProps) => {
openContextMenu,
outline,
linksByNodeId,
+ macros,
+ attachDir,
}}
previewNode={nodeById[id]!}
collapse={false}
diff --git a/components/Sidebar/Note.tsx b/components/Sidebar/Note.tsx
index 1f864f3..2b76994 100644
--- a/components/Sidebar/Note.tsx
+++ b/components/Sidebar/Note.tsx
@@ -21,6 +21,7 @@ export interface NoteProps {
outline: boolean
collapse: boolean
macros?: { [key: string]: string }
+ attachDir: string
}
export const Note = (props: NoteProps) => {
@@ -37,6 +38,7 @@ export const Note = (props: NoteProps) => {
outline,
collapse,
macros,
+ attachDir,
} = props
const extraStyle = outline ? outlineNoteStyle : viewerNoteStyle
@@ -71,6 +73,7 @@ export const Note = (props: NoteProps) => {
nodeById,
linksByNodeId,
macros,
+ attachDir,
}}
/>
<Backlinks
@@ -83,7 +86,9 @@ export const Note = (props: NoteProps) => {
setSidebarHighlightedNode,
openContextMenu,
outline,
+ attachDir,
}}
+ macros={macros || {}}
/>
</Flex>
)}
diff --git a/components/Sidebar/index.tsx b/components/Sidebar/index.tsx
index c23d938..66728fd 100644
--- a/components/Sidebar/index.tsx
+++ b/components/Sidebar/index.tsx
@@ -50,6 +50,7 @@ export interface SidebarProps {
tagColors: TagColors
setTagColors: any
macros?: { [key: string]: string }
+ attachDir: string
}
const Sidebar = (props: SidebarProps) => {
@@ -77,6 +78,7 @@ const Sidebar = (props: SidebarProps) => {
tagColors,
setTagColors,
macros,
+ attachDir,
} = props
const { highlightColor } = useContext(ThemeContext)
@@ -228,6 +230,7 @@ const Sidebar = (props: SidebarProps) => {
setOutline,
collapse,
macros,
+ attachDir,
}}
/>
</VStack>