From ee8539a9351374a719c9026f85d85e7b4ea6e8f5 Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <hello@tefkah.com>
Date: Sat, 25 Sep 2021 16:11:31 +0200
Subject: chore: move tweaks to separate subfolder

---
 components/Tweaks/VisualsPanel.tsx | 100 +++++++++++++++++++++++++++++++++++++
 1 file changed, 100 insertions(+)
 create mode 100644 components/Tweaks/VisualsPanel.tsx

(limited to 'components/Tweaks/VisualsPanel.tsx')

diff --git a/components/Tweaks/VisualsPanel.tsx b/components/Tweaks/VisualsPanel.tsx
new file mode 100644
index 0000000..559975d
--- /dev/null
+++ b/components/Tweaks/VisualsPanel.tsx
@@ -0,0 +1,100 @@
+import {
+  Text,
+  Accordion,
+  AccordionButton,
+  AccordionItem,
+  Flex,
+  VStack,
+  AccordionIcon,
+  AccordionPanel,
+} from '@chakra-ui/react'
+import React, { useCallback } from 'react'
+import { HighlightingPanel } from './HighlightingPanel'
+import { ColorsPanel } from './ColorsPanel'
+import { initialVisuals } from '../config'
+import { NodesNLinksPanel } from './NodesNLinksPanel'
+import { LabelsPanel } from './LabelsPanel'
+import { CitationsPanel } from './CitationsPanel'
+
+export interface VisualsPanelProps {
+  visuals: typeof initialVisuals
+  setVisuals: any
+  highlightColor: string
+  setHighlightColor: any
+  threeDim: boolean
+}
+
+export const VisualsPanel = (props: VisualsPanelProps) => {
+  const { visuals, setVisuals, highlightColor, setHighlightColor, threeDim } = props
+  const setVisualsCallback = useCallback((val) => setVisuals(val), [])
+  return (
+    <VStack justifyContent="flex-start" align="stretch">
+      <Accordion allowToggle defaultIndex={[0]} paddingLeft={3}>
+        <AccordionItem>
+          <AccordionButton>
+            <Flex justifyContent="space-between" w="100%">
+              <Text>Colors</Text>
+              <AccordionIcon marginRight={2} />
+            </Flex>
+          </AccordionButton>
+          <AccordionPanel>
+            <ColorsPanel
+              visuals={visuals}
+              setVisualsCallback={setVisualsCallback}
+              highlightColor={highlightColor}
+              setHighlightColor={setHighlightColor}
+            />
+          </AccordionPanel>
+        </AccordionItem>
+        <AccordionItem>
+          <AccordionButton>
+            <Flex justifyContent="space-between" w="100%">
+              <Text>Nodes & Links</Text>
+              <AccordionIcon marginRight={2} />
+            </Flex>
+          </AccordionButton>
+          <AccordionPanel>
+            <NodesNLinksPanel
+              visuals={visuals}
+              setVisuals={setVisualsCallback}
+              threeDim={threeDim}
+            />
+          </AccordionPanel>
+        </AccordionItem>
+        <AccordionItem>
+          <AccordionButton>
+            <Flex justifyContent="space-between" w="100%">
+              <Text>Labels</Text>
+              <AccordionIcon marginRight={2} />
+            </Flex>
+          </AccordionButton>
+          <AccordionPanel>
+            <LabelsPanel visuals={visuals} setVisuals={setVisualsCallback} />
+          </AccordionPanel>
+        </AccordionItem>
+        <AccordionItem>
+          <AccordionButton>
+            <Flex justifyContent="space-between" w="100%">
+              <Text>Highlighting</Text>
+              <AccordionIcon marginRight={2} />
+            </Flex>
+          </AccordionButton>
+          <AccordionPanel>
+            <HighlightingPanel visuals={visuals} setVisuals={setVisualsCallback} />
+          </AccordionPanel>
+        </AccordionItem>
+        <AccordionItem>
+          <AccordionButton>
+            <Flex justifyContent="space-between" w="100%">
+              <Text>Citations</Text>
+              <AccordionIcon marginRight={2} />
+            </Flex>
+          </AccordionButton>
+          <AccordionPanel>
+            <CitationsPanel visuals={visuals} setVisuals={setVisualsCallback} />
+          </AccordionPanel>
+        </AccordionItem>
+      </Accordion>
+    </VStack>
+  )
+}
-- 
cgit v1.2.3

