diff options
author | Thomas F. K. Jorna <[email protected]> | 2021-10-09 19:24:35 +0200 |
---|---|---|
committer | Thomas F. K. Jorna <[email protected]> | 2021-10-09 19:24:35 +0200 |
commit | 264292673468df3713dbb0330a3b2190fb60de17 (patch) | |
tree | f38dbeee42d543907ed96b3801b052cf62adb15e /components/Sidebar | |
parent | cbbe66126c5281c2d6e18487dd76516f6e77d4f8 (diff) |
fix: correct image export
Diffstat (limited to 'components/Sidebar')
-rw-r--r-- | components/Sidebar/OrgImage.tsx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/components/Sidebar/OrgImage.tsx b/components/Sidebar/OrgImage.tsx index e8773e2..d602f0c 100644 --- a/components/Sidebar/OrgImage.tsx +++ b/components/Sidebar/OrgImage.tsx @@ -12,8 +12,6 @@ export const OrgImage = (props: OrgImageProps) => { const { src, file } = props const [image, setImage] = useState<any>(null) - const dir = path.dirname(file) - const fullPath = encodeURIComponent(encodeURIComponent(path.join(dir, src))) /* ) * .then((res) => res.blob()) @@ -24,5 +22,12 @@ export const OrgImage = (props: OrgImageProps) => { * }) }, [fullPath]) */ - return <Image src={`http://localhost:35901/img/${fullPath}`} alt="" width={100} height={100} /> + const dir = path.dirname(src) + 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} /> } |