From 110cf8121332d390eac69a656be0e23c2dff50f8 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 31 Dec 2021 16:21:07 +0100 Subject: [PATCH] feat(nui): Entry animation --- ui/src/components/App.tsx | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/ui/src/components/App.tsx b/ui/src/components/App.tsx index 4fb7eae..d26eb1b 100644 --- a/ui/src/components/App.tsx +++ b/ui/src/components/App.tsx @@ -1,11 +1,13 @@ -import { Center, Box } from '@chakra-ui/react'; +import { Center, Box, BoxProps } from '@chakra-ui/react'; import { debugData } from '../utils/debugData'; +import { motion } from 'framer-motion'; import TopBar from './NavBars/TopBar'; import LeftBar from './NavBars/LeftBar'; import { Routes, Route } from 'react-router-dom'; import Resource from './Resource'; import RightBar from './NavBars/RightBar'; import MainContent from './MainContent'; +import { useVisibility } from '../providers/VisibilityProvider'; debugData([ { @@ -14,19 +16,34 @@ debugData([ }, ]); +const MotionBox = motion(Box); + const App: React.FC = () => { + const { visible } = useVisibility(); + return (
- - - - - - - } /> - - - + {visible && ( + + + + + + + } /> + + + + )}
); };