From ee8539a9351374a719c9026f85d85e7b4ea6e8f5 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Sat, 25 Sep 2021 16:11:31 +0200 Subject: chore: move tweaks to separate subfolder --- components/tweaks.tsx | 217 -------------------------------------------------- 1 file changed, 217 deletions(-) delete mode 100644 components/tweaks.tsx (limited to 'components/tweaks.tsx') diff --git a/components/tweaks.tsx b/components/tweaks.tsx deleted file mode 100644 index a78c7f4..0000000 --- a/components/tweaks.tsx +++ /dev/null @@ -1,217 +0,0 @@ -import { CloseIcon, RepeatClockIcon, SettingsIcon } from '@chakra-ui/icons' -import { - Accordion, - AccordionButton, - AccordionIcon, - AccordionItem, - AccordionPanel, - Box, - Button, - IconButton, - Tooltip, - Heading, -} from '@chakra-ui/react' - -import React, { useContext } from 'react' -import Scrollbars from 'react-custom-scrollbars-2' -import { - initialPhysics, - initialFilter, - initialVisuals, - initialMouse, - initialBehavior, - TagColors, - colorList, -} from './config' - -import FilterPanel from './FilterPanel' - -import { ThemeContext } from '../util/themecontext' -import { usePersistantState } from '../util/persistant-state' -import { PhysicsPanel } from './PhysicsPanel' -import { VisualsPanel } from './VisualsPanel' -import { BehaviorPanel } from './BehaviorPanel' - -export interface TweakProps { - physics: typeof initialPhysics - setPhysics: any - threeDim: boolean - setThreeDim: (newValue: boolean) => void - filter: typeof initialFilter - setFilter: any - visuals: typeof initialVisuals - setVisuals: any - mouse: typeof initialMouse - setMouse: any - behavior: typeof initialBehavior - setBehavior: any - tags: string[] - tagColors: TagColors - setTagColors: any -} - -export const Tweaks = (props: TweakProps) => { - const { - physics, - setPhysics, - threeDim, - setThreeDim, - filter, - setFilter, - visuals, - setVisuals, - mouse, - setMouse, - behavior, - setBehavior, - tags, - tagColors, - setTagColors, - } = props - const [showTweaks, setShowTweaks] = usePersistantState('showTweaks', false) - const { highlightColor, setHighlightColor } = useContext(ThemeContext) - - return !showTweaks ? ( - - } - onClick={() => setShowTweaks(true)} - /> - - ) : ( - - - - - - - - } - onClick={() => { - setVisuals(initialVisuals) - setFilter(initialFilter) - setMouse(initialMouse) - setPhysics(initialPhysics) - setBehavior(initialBehavior) - }} - variant="none" - size="sm" - /> - - } - aria-label="Close Tweak Panel" - variant="ghost" - onClick={() => setShowTweaks(false)} - /> - - - ( - - )} - > - - - - - Filter - - - - - - - - - - Physics - - - - - - - - - - Visual - - - - - - - - - Behavior - - - - - - - - - ) -} -- cgit v1.2.3