From 1bd37ff86e5d5e2397b77c10fcc90e80bfbfce49 Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <thomasfkjorna@gmail.com>
Date: Sat, 31 Jul 2021 11:17:58 +0200
Subject: refactoring

---
 components/tweaks.tsx | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

(limited to 'components/tweaks.tsx')

diff --git a/components/tweaks.tsx b/components/tweaks.tsx
index b2b0aaf..b5ce2ec 100644
--- a/components/tweaks.tsx
+++ b/components/tweaks.tsx
@@ -37,6 +37,7 @@ import {
   Collapse,
   Grid,
   Portal,
+  SlideFade,
 } from '@chakra-ui/react'
 import React, { useState, useContext } from 'react'
 import Scrollbars from 'react-custom-scrollbars-2'
@@ -102,20 +103,22 @@ export const Tweaks = (props: TweakProps) => {
   ]
   return (
     <>
-      <Box
-        position="relative"
-        zIndex="overlay"
-        marginTop={10}
-        marginLeft={10}
-        display={showTweaks ? 'none' : 'block'}
-      >
-        <IconButton
-          aria-label="Settings"
-          icon={<SettingsIcon />}
-          onClick={() => setShowTweaks(true)}
-        />
-      </Box>
-      <Collapse in={showTweaks} animateOpacity>
+      <SlideFade in={!showTweaks} animateOpacity>
+        <Box
+          position="absolute"
+          zIndex="overlay"
+          marginTop={10}
+          marginLeft={10}
+          display={showTweaks ? 'none' : 'block'}
+        >
+          <IconButton
+            aria-label="Settings"
+            icon={<SettingsIcon />}
+            onClick={() => setShowTweaks(true)}
+          />
+        </Box>
+      </SlideFade>
+      <SlideFade in={showTweaks} animateOpacity>
         <Box
           bg="alt.100"
           w="xs"
@@ -1191,7 +1194,7 @@ export const Tweaks = (props: TweakProps) => {
             </Accordion>
           </Scrollbars>
         </Box>
-      </Collapse>
+      </SlideFade>
     </>
   )
 }
-- 
cgit v1.2.3

