diff options
author | Thomas F. K. Jorna <[email protected]> | 2022-09-27 15:35:19 +0200 |
---|---|---|
committer | Thomas F. K. Jorna <[email protected]> | 2022-09-27 15:35:19 +0200 |
commit | fb26ac08618339f113749ea85c88ea69d255402b (patch) | |
tree | 9b8ccf64df290dc5c5cdf70778cca737b9aec3ba /components | |
parent | a575d14b6621d5464d33d52ca642f2db70c3e370 (diff) |
fix: small bugs
Diffstat (limited to 'components')
-rw-r--r-- | components/Sidebar/Backlinks.tsx | 2 | ||||
-rw-r--r-- | components/Sidebar/Link.tsx | 17 | ||||
-rw-r--r-- | components/Sidebar/Note.tsx | 2 | ||||
-rw-r--r-- | components/Sidebar/OrgImage.tsx | 4 | ||||
-rw-r--r-- | components/Sidebar/Section.tsx | 16 | ||||
-rw-r--r-- | components/Sidebar/Title.tsx | 1 | ||||
-rw-r--r-- | components/Sidebar/Toolbar.tsx | 12 |
7 files changed, 16 insertions, 38 deletions
diff --git a/components/Sidebar/Backlinks.tsx b/components/Sidebar/Backlinks.tsx index 0bbf415..5a8f6fc 100644 --- a/components/Sidebar/Backlinks.tsx +++ b/components/Sidebar/Backlinks.tsx @@ -2,7 +2,6 @@ import { LinksByNodeId, NodeByCite, NodeById } from '../../pages/index' import { GraphData, NodeObject, LinkObject } from 'force-graph' -import { normalizeLinkEnds } from '../../pages/index' import { VStack, Box, Button, Heading, StackDivider } from '@chakra-ui/react' import React from 'react' import { ProcessedOrg } from '../../util/processOrg' @@ -24,6 +23,7 @@ export interface BacklinksProps { import { PreviewLink } from './Link' import { OrgRoamNode } from '../../api' import { Section } from './Section' +import { normalizeLinkEnds } from '../../util/normalizeLinkEnds' export const Backlinks = (props: BacklinksProps) => { const { diff --git a/components/Sidebar/Link.tsx b/components/Sidebar/Link.tsx index 2f1ad64..73830ce 100644 --- a/components/Sidebar/Link.tsx +++ b/components/Sidebar/Link.tsx @@ -14,17 +14,17 @@ import { Text, useTheme, } from '@chakra-ui/react' -import React, { ReactElement, useContext, useEffect, useMemo, useState } from 'react' +import React, { useContext, useEffect, useMemo, useState } from 'react' import { ProcessedOrg } from '../../util/processOrg' -import unified from 'unified' +// import unified from 'unified' //import createStream from 'unified-stream' -import uniorgParse from 'uniorg-parse' -import uniorg2rehype from 'uniorg-rehype' +// import uniorgParse from 'uniorg-parse' +// import uniorg2rehype from 'uniorg-rehype' //import highlight from 'rehype-highlight' -import katex from 'rehype-katex' +// import katex from 'rehype-katex' import 'katex/dist/katex.css' -import rehype2react from 'rehype-react' +// import rehype2react from 'rehype-react' import { ThemeContext } from '../../util/themecontext' import { LinksByNodeId, NodeByCite, NodeById } from '../../pages' @@ -63,13 +63,10 @@ export interface NormalLinkProps { children: string } -import { hexToRGBA, getThemeColor } from '../../pages/index' import { defaultNoteStyle, viewerNoteStyle, outlineNoteStyle } from './noteStyle' -import { OrgImage } from './OrgImage' import { Scrollbars } from 'react-custom-scrollbars-2' import { ExternalLinkIcon } from '@chakra-ui/icons' -import { Section } from './Section' -import { OrgRoamLink } from '../../api' +import { getThemeColor } from '../../util/getThemeColor' export const NodeLink = (props: NodeLinkProps) => { const { diff --git a/components/Sidebar/Note.tsx b/components/Sidebar/Note.tsx index 638b43a..3d55816 100644 --- a/components/Sidebar/Note.tsx +++ b/components/Sidebar/Note.tsx @@ -1,7 +1,7 @@ import React from 'react' import { NodeObject } from 'force-graph' -import { NodeById, NodeByCite, LinksByNodeId, normalizeLinkEnds } from '../../pages' +import { NodeById, NodeByCite, LinksByNodeId } from '../../pages' import { Box, Flex } from '@chakra-ui/react' import { UniOrg } from '../../util/uniorg' import { Backlinks } from '../../components/Sidebar/Backlinks' diff --git a/components/Sidebar/OrgImage.tsx b/components/Sidebar/OrgImage.tsx index 0922834..f371f49 100644 --- a/components/Sidebar/OrgImage.tsx +++ b/components/Sidebar/OrgImage.tsx @@ -1,5 +1,5 @@ /* eslint-disable @next/next/no-img-element */ -import React, { useEffect, useState } from 'react' +import React, { useState } from 'react' import Image from 'next/image' import path from 'path' import { Container } from '@chakra-ui/react' @@ -13,7 +13,7 @@ export interface OrgImageProps { export const OrgImage = (props: OrgImageProps) => { const { src, file } = props - const [image, setImage] = useState<any>(null) + // const [image, setImage] = useState<any>(null) /* ) * .then((res) => res.blob()) diff --git a/components/Sidebar/Section.tsx b/components/Sidebar/Section.tsx index adaf00e..7e99f4f 100644 --- a/components/Sidebar/Section.tsx +++ b/components/Sidebar/Section.tsx @@ -1,17 +1,7 @@ -import { Box, Collapse, Flex, IconButton } from '@chakra-ui/react' -import React, { - JSXElementConstructor, - ReactChild, - ReactElement, - ReactNode, - useContext, - useEffect, - useState, -} from 'react' -import { BiCaretDownCircle, BiChevronDownCircle, BiCircle } from 'react-icons/bi' -import { ComponentLike, ComponentPropsWithoutNode } from 'rehype-react' +import { Box, Flex, IconButton } from '@chakra-ui/react' +import React, { ReactChild, useContext, useEffect, useState } from 'react' import { VscCircleFilled, VscCircleOutline } from 'react-icons/vsc' -import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon } from '@chakra-ui/icons' +import { ChevronDownIcon, ChevronUpIcon } from '@chakra-ui/icons' import { NoteContext } from '../../util/NoteContext' export interface SectionProps { diff --git a/components/Sidebar/Title.tsx b/components/Sidebar/Title.tsx index 2c8d8b7..791cbb8 100644 --- a/components/Sidebar/Title.tsx +++ b/components/Sidebar/Title.tsx @@ -1,6 +1,5 @@ import { Flex, Heading } from '@chakra-ui/react' import React from 'react' -import { BiFile } from 'react-icons/bi' import { OrgRoamNode } from '../../api' export interface TitleProps { diff --git a/components/Sidebar/Toolbar.tsx b/components/Sidebar/Toolbar.tsx index 71f3807..f606837 100644 --- a/components/Sidebar/Toolbar.tsx +++ b/components/Sidebar/Toolbar.tsx @@ -1,17 +1,9 @@ import React from 'react' -import { Text, Flex, IconButton, ButtonGroup, Tooltip } from '@chakra-ui/react' -import { - BiAlignJustify, - BiAlignLeft, - BiAlignMiddle, - BiAlignRight, - BiFont, - BiRightIndent, -} from 'react-icons/bi' +import { Flex, IconButton, ButtonGroup, Tooltip } from '@chakra-ui/react' +import { BiAlignJustify, BiAlignLeft, BiAlignMiddle, BiAlignRight } from 'react-icons/bi' import { MdOutlineExpand, MdOutlineCompress } from 'react-icons/md' import { ChevronLeftIcon, ChevronRightIcon } from '@chakra-ui/icons' import { IoIosListBox, IoMdListBox } from 'react-icons/io' -import { NodeObject } from 'force-graph' export interface ToolbarProps { setJustification: any |