From ebc3e97c9fdaabfc4fcd9c35525f302ad3a8cb45 Mon Sep 17 00:00:00 2001 From: Kirill Rogovoy Date: Sun, 25 Jul 2021 14:38:05 +0300 Subject: Move showTweaks to tweaks.tsx --- components/tweaks.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'components/tweaks.tsx') diff --git a/components/tweaks.tsx b/components/tweaks.tsx index a082306..ab5a6a7 100644 --- a/components/tweaks.tsx +++ b/components/tweaks.tsx @@ -25,6 +25,7 @@ import { Tooltip, VStack, } from '@chakra-ui/react' +import { useState } from 'react' import Scrollbars from 'react-custom-scrollbars-2' import { initialPhysics, initialFilter } from './config' @@ -35,11 +36,22 @@ export interface TweakProps { setThreeDim: (newValue: boolean) => void filter: typeof initialFilter setFilter: any - onClose: () => void } export const Tweaks = (props: TweakProps) => { - const { physics, setPhysics, threeDim, filter, setFilter, onClose } = props + const { physics, setPhysics, threeDim, filter, setFilter } = props + const [showTweaks, setShowTweaks] = useState(true) + + if (!showTweaks) { + return + } + onClick={() => setShowTweaks(true)} + /> + + } + return ( { borderRadius="md" maxH={650} paddingBottom={5} - //overflowY="scroll" > @@ -62,7 +73,7 @@ export const Tweaks = (props: TweakProps) => { colorScheme="purple" /> - + setShowTweaks(false)} />