8
8
import { useSelectedLayoutSegment , usePathname } from "next/navigation" ;
9
9
import type { ComponentProps } from "react" ;
10
10
11
- import type { VariantArg } from "../LayoutTransition" ;
12
- import { LayoutTransition } from "../LayoutTransition" ;
11
+ // import type { VariantArg } from "../LayoutTransition";
12
+ // import { LayoutTransition } from "../LayoutTransition";
13
13
14
14
export const TabRoot = (
15
15
props : Omit < ComponentProps < typeof Tabs > , "selectedKey" > ,
@@ -27,46 +27,47 @@ export const MainNavTabs = (
27
27
return < MainNavTabsComponent pathname = { pathname } { ...props } /> ;
28
28
} ;
29
29
30
- export const TabPanel = ( {
31
- children,
32
- ...props
33
- } : Omit < ComponentProps < typeof UnstyledTabPanel > , "id" > ) => {
30
+ export const TabPanel = (
31
+ props : Omit < ComponentProps < typeof UnstyledTabPanel > , "id" > ,
32
+ ) => {
34
33
const tabId = useSelectedLayoutSegment ( ) ?? "" ;
35
34
36
- return (
37
- < UnstyledTabPanel key = "tabpanel" id = { tabId } { ...props } >
38
- { ( args ) => (
39
- < LayoutTransition
40
- variants = { {
41
- initial : ( custom ) => ( {
42
- opacity : 0 ,
43
- x : isMovingLeft ( custom ) ? "-2%" : "2%" ,
44
- } ) ,
45
- exit : ( custom ) => ( {
46
- opacity : 0 ,
47
- x : isMovingLeft ( custom ) ? "2%" : "-2%" ,
48
- transition : {
49
- x : { type : "spring" , bounce : 0 } ,
50
- } ,
51
- } ) ,
52
- } }
53
- initial = "initial"
54
- animate = { {
55
- opacity : 1 ,
56
- x : 0 ,
57
- transition : {
58
- x : { type : "spring" , bounce : 0 } ,
59
- } ,
60
- } }
61
- exit = "exit"
62
- >
63
- { typeof children === "function" ? children ( args ) : children }
64
- </ LayoutTransition >
65
- ) }
66
- </ UnstyledTabPanel >
67
- ) ;
35
+ return < UnstyledTabPanel key = "tabpanel" id = { tabId } { ...props } /> ;
36
+
37
+ // return (
38
+ // <UnstyledTabPanel key="tabpanel" id={tabId} {...props}>
39
+ // {(args) => (
40
+ // <LayoutTransition
41
+ // variants={{
42
+ // initial: (custom) => ({
43
+ // opacity: 0,
44
+ // x: isMovingLeft(custom) ? "-2%" : "2%",
45
+ // }),
46
+ // exit: (custom) => ({
47
+ // opacity: 0,
48
+ // x: isMovingLeft(custom) ? "2%" : "-2%",
49
+ // transition: {
50
+ // x: { type: "spring", bounce: 0 },
51
+ // },
52
+ // }),
53
+ // }}
54
+ // initial="initial"
55
+ // animate={{
56
+ // opacity: 1,
57
+ // x: 0,
58
+ // transition: {
59
+ // x: { type: "spring", bounce: 0 },
60
+ // },
61
+ // }}
62
+ // exit="exit"
63
+ // >
64
+ // {typeof children === "function" ? children(args) : children}
65
+ // </LayoutTransition>
66
+ // )}
67
+ // </UnstyledTabPanel>
68
+ // );
68
69
} ;
69
70
70
- const isMovingLeft = ( { segment, prevSegment } : VariantArg ) : boolean =>
71
- segment === null ||
72
- ( segment === "publishers" && prevSegment === "price-feeds" ) ;
71
+ // const isMovingLeft = ({ segment, prevSegment }: VariantArg): boolean =>
72
+ // segment === null ||
73
+ // (segment === "publishers" && prevSegment === "price-feeds");
0 commit comments