summaryrefslogtreecommitdiff
path: root/components/Sidebar/Toolbar.tsx
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-10-09 22:20:34 +0200
committerThomas F. K. Jorna <[email protected]>2021-10-09 22:20:34 +0200
commit31d7477b376501bd80fe635b91412bc7f6ae7ea7 (patch)
treeb0fcc9b289cef86385805fe606b70d1ee14f1b25 /components/Sidebar/Toolbar.tsx
parent9d1692fbcf322db2d95586b1ab6768ba9328e5df (diff)
feat(preview): node history
Diffstat (limited to 'components/Sidebar/Toolbar.tsx')
-rw-r--r--components/Sidebar/Toolbar.tsx36
1 files changed, 33 insertions, 3 deletions
diff --git a/components/Sidebar/Toolbar.tsx b/components/Sidebar/Toolbar.tsx
index 458361f..f6f1e39 100644
--- a/components/Sidebar/Toolbar.tsx
+++ b/components/Sidebar/Toolbar.tsx
@@ -9,21 +9,51 @@ import {
BiRightIndent,
} from 'react-icons/bi'
import { ChevronLeftIcon, ChevronRightIcon } from '@chakra-ui/icons'
+import { NodeObject } from 'force-graph'
export interface ToolbarProps {
setJustification: any
justification: number
setIndent: any
setFont: any
+ setPreviewNode: any
+ canUndo: any
+ canRedo: any
+ resetPreviewNode: any
+ previousPreviewNode: any
+ nextPreviewNode: any
}
export const Toolbar = (props: ToolbarProps) => {
- const { setJustification, setIndent, setFont, justification } = props
+ const {
+ setJustification,
+ setIndent,
+ setFont,
+ justification,
+ setPreviewNode,
+ canUndo,
+ canRedo,
+ resetPreviewNode,
+ previousPreviewNode,
+ nextPreviewNode,
+ } = props
return (
<Flex py={3} alignItems="center" justifyContent="space-between" pr={4}>
<Flex>
- <IconButton variant="ghost" icon={<ChevronLeftIcon />} aria-label="Previous node" />
- <IconButton variant="ghost" icon={<ChevronRightIcon />} aria-label="Previous node" />
+ <IconButton
+ variant="ghost"
+ icon={<ChevronLeftIcon />}
+ aria-label="Previous node"
+ disabled={!canUndo}
+ onClick={() => previousPreviewNode()}
+ />
+ <IconButton
+ variant="ghost"
+ icon={<ChevronRightIcon />}
+ aria-label="Next node"
+ disabled={!canRedo}
+ onClick={() => nextPreviewNode()}
+ />
</Flex>
<Flex>
<IconButton