From dad03e3be5b0a7c1159e0207cce11540ca830359 Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <hello@tefkah.com>
Date: Mon, 3 Jan 2022 17:21:18 +0100
Subject: feat(filter): add option to filter by subdirectory (#190)

---
 components/Tweaks/FilterPanel.tsx | 220 --------------------------------------
 1 file changed, 220 deletions(-)
 delete mode 100644 components/Tweaks/FilterPanel.tsx

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

diff --git a/components/Tweaks/FilterPanel.tsx b/components/Tweaks/FilterPanel.tsx
deleted file mode 100644
index ad0c5e4..0000000
--- a/components/Tweaks/FilterPanel.tsx
+++ /dev/null
@@ -1,220 +0,0 @@
-import { ChevronDownIcon } from '@chakra-ui/icons'
-import {
-  Text,
-  Box,
-  Button,
-  Flex,
-  Menu,
-  MenuButton,
-  StackDivider,
-  VStack,
-  Portal,
-  MenuList,
-  MenuItem,
-  Switch,
-  Accordion,
-  AccordionItem,
-  AccordionButton,
-  AccordionIcon,
-  AccordionPanel,
-} from '@chakra-ui/react'
-import React from 'react'
-import { TagPanel } from './TagPanel'
-import { initialFilter, initialLocal, TagColors } from '../config'
-import { TagColorPanel } from './TagColorPanel'
-import { SliderWithInfo } from './SliderWithInfo'
-
-export interface FilterPanelProps {
-  filter: typeof initialFilter
-  setFilter: any
-  tagColors: TagColors
-  setTagColors: any
-  highlightColor: string
-  colorList: string[]
-  tags: string[]
-  local: typeof initialLocal
-  setLocal: any
-}
-
-const FilterPanel = (props: FilterPanelProps) => {
-  const {
-    filter,
-    setFilter,
-    local,
-    setLocal,
-    tagColors,
-    setTagColors,
-    highlightColor,
-    colorList,
-    tags,
-  } = props
-  return (
-    <Box>
-      <VStack
-        spacing={2}
-        justifyContent="flex-start"
-        divider={<StackDivider borderColor="gray.500" />}
-        align="stretch"
-        paddingLeft={7}
-        color="gray.800"
-      >
-        <Flex alignItems="center" justifyContent="space-between">
-          <Text>Link children to</Text>
-          <Menu isLazy placement="right">
-            <MenuButton
-              as={Button}
-              rightIcon={<ChevronDownIcon />}
-              colorScheme=""
-              color="black"
-              size="sm"
-            >
-              {(() => {
-                switch (filter.parent) {
-                  case 'parent':
-                    return <Text>File</Text>
-                  case 'heading':
-                    return <Text>Heading</Text>
-                  default:
-                    return <Text>Nothing</Text>
-                }
-              })()}
-            </MenuButton>
-            <Portal>
-              {' '}
-              <MenuList bgColor="gray.200" zIndex="popover">
-                <MenuItem
-                  onClick={() =>
-                    setFilter((curr: typeof initialFilter) => ({ ...curr, parent: '' }))
-                  }
-                >
-                  Nothing
-                </MenuItem>
-                <MenuItem
-                  onClick={() =>
-                    setFilter((curr: typeof initialFilter) => ({
-                      ...curr,
-                      parent: 'parent',
-                    }))
-                  }
-                >
-                  Parent file node
-                </MenuItem>
-                <MenuItem
-                  onClick={() =>
-                    setFilter((curr: typeof initialFilter) => ({
-                      ...curr,
-                      parent: 'heading',
-                    }))
-                  }
-                >
-                  Next highest heading node
-                </MenuItem>
-              </MenuList>
-            </Portal>
-          </Menu>
-        </Flex>
-        <Flex justifyContent="space-between">
-          <Text>Orphans</Text>
-          <Switch
-            onChange={() => {
-              setFilter((curr: typeof initialFilter) => {
-                return { ...curr, orphans: !curr.orphans }
-              })
-            }}
-            isChecked={filter.orphans}
-          ></Switch>
-        </Flex>
-        <Flex justifyContent="space-between">
-          <Text>Dailies</Text>
-          <Switch
-            onChange={() => {
-              setFilter((curr: typeof initialFilter) => {
-                return { ...curr, dailies: !curr.dailies }
-              })
-            }}
-            isChecked={filter.dailies}
-          ></Switch>
-        </Flex>
-        <Flex justifyContent="space-between">
-          <Text>Org-noter pages</Text>
-          <Switch
-            onChange={() => {
-              setFilter((curr: typeof initialFilter) => {
-                return { ...curr, noter: !curr.noter }
-              })
-            }}
-            isChecked={filter.noter}
-          ></Switch>
-        </Flex>
-        <Flex justifyContent="space-between">
-          <Text>Citations without note files</Text>
-          <Switch
-            onChange={() => {
-              setFilter({ ...filter, filelessCites: !filter.filelessCites })
-            }}
-            isChecked={filter.filelessCites}
-          ></Switch>
-        </Flex>
-        <Flex justifyContent="space-between">
-          <Text>Non-existent nodes</Text>
-          <Switch
-            onChange={() => {
-              setTagColors({ ...tagColors, bad: 'white' })
-              setFilter({ ...filter, bad: !filter.bad })
-            }}
-            isChecked={filter.bad}
-          ></Switch>
-        </Flex>
-        <SliderWithInfo
-          label="Number of neighbors in local graph"
-          value={local.neighbors}
-          onChange={(v) => setLocal({ ...local, neighbors: v })}
-          min={1}
-          max={5}
-          step={1}
-        />
-      </VStack>
-      <Accordion padding={0} allowToggle allowMultiple paddingLeft={3}>
-        <AccordionItem>
-          <AccordionButton>
-            Tag filters
-            <AccordionIcon />
-          </AccordionButton>
-          <AccordionPanel pr={0} mr={0}>
-            <TagPanel
-              highlightColor={highlightColor}
-              filter={filter}
-              setFilter={setFilter}
-              tags={tags}
-              mode="blacklist"
-            />
-            <TagPanel
-              highlightColor={highlightColor}
-              filter={filter}
-              setFilter={setFilter}
-              tags={tags}
-              mode="whitelist"
-            />
-          </AccordionPanel>
-        </AccordionItem>
-        <AccordionItem>
-          <AccordionButton>
-            Tag colors
-            <AccordionIcon />
-          </AccordionButton>
-          <AccordionPanel pr={0} mr={0}>
-            <TagColorPanel
-              tags={tags}
-              colorList={colorList}
-              tagColors={tagColors}
-              setTagColors={setTagColors}
-              highlightColor={highlightColor}
-            />
-          </AccordionPanel>
-        </AccordionItem>
-      </Accordion>
-    </Box>
-  )
-}
-
-export default FilterPanel
-- 
cgit v1.2.3

