summaryrefslogtreecommitdiff
path: root/components/Sidebar
diff options
context:
space:
mode:
Diffstat (limited to 'components/Sidebar')
-rw-r--r--components/Sidebar/Link.tsx5
-rw-r--r--components/Sidebar/OrgImage.tsx6
2 files changed, 6 insertions, 5 deletions
diff --git a/components/Sidebar/Link.tsx b/components/Sidebar/Link.tsx
index 4463fb8..3791c74 100644
--- a/components/Sidebar/Link.tsx
+++ b/components/Sidebar/Link.tsx
@@ -134,14 +134,13 @@ export const PreviewLink = (props: LinkProps) => {
</PreviewLink>
),
img: ({ src }) => {
- return <OrgImage src={src as string} file={file} />
+ return <OrgImage src={src as string} file={nodeById[id]?.file as string} />
},
},
})
const getText = () => {
- console.log('gettin text')
- fetch(`127.0.0.1:35901/file/${file}`)
+ fetch(`http://localhost:35901/file/${file}`)
.then((res) => {
return res.text()
})
diff --git a/components/Sidebar/OrgImage.tsx b/components/Sidebar/OrgImage.tsx
index d602f0c..a87fc4c 100644
--- a/components/Sidebar/OrgImage.tsx
+++ b/components/Sidebar/OrgImage.tsx
@@ -22,12 +22,14 @@ export const OrgImage = (props: OrgImageProps) => {
* })
}, [fullPath]) */
- const dir = path.dirname(src)
+ const dir = path.dirname(file)
const fullPath = encodeURIComponent(encodeURIComponent(path.join(dir, src)))
const dumbLoader = ({ src, width, quality }: { [key: string]: string | number }) => {
return `http://localhost:35901/img/${src}`
}
- return <Image unoptimized loader={dumbLoader} src={fullPath} alt="" width={100} height={100} />
+ return (
+ <Image layout="responsive" loader={dumbLoader} src={fullPath} alt="" width="70%" height="70%" />
+ )
}