diff --git a/interface/src/components/TabbedContainer.tsx b/interface/src/components/TabbedContainer.tsx index e29c9137..ea5e4a29 100644 --- a/interface/src/components/TabbedContainer.tsx +++ b/interface/src/components/TabbedContainer.tsx @@ -1,5 +1,5 @@ import React, { useState, useRef, useEffect } from 'react'; -import { motion } from 'framer-motion'; +import { motion, AnimatePresence } from 'framer-motion'; import type { TabbedContainerProps } from '../types/TabbedContainerProps'; import { useSettingsContext } from '../SettingsContext'; @@ -21,6 +21,13 @@ const TabbedContainer: React.FC = ({ tabs }) => { const springTransition = { type: 'spring', stiffness: 250, damping: 25 }; + const contentVariants = { + hidden: { opacity: 0 }, + visible: { opacity: 1 }, + }; + + const fastOpacityTransition = { duration: 0.2 }; + useEffect(() => { if (containerRef.current) { // @ts-expect-error for some reason its giving an error in TS but it works... @@ -61,23 +68,32 @@ const TabbedContainer: React.FC = ({ tabs }) => {
- -
- {tabs.map((tab, index) => ( -
- {tab.content} -
- ))} -
-
-
+ +
+ + {tabs.map((tab, index) => ( + activeTab === index && ( + + {tab.content} + + ) + ))} + +
+
+ ); };