Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions examples/core/auth-nextjs-themed/app/components/CustomTreeView.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use client';
import * as React from 'react';
import clsx from 'clsx';
import { animated, useSpring } from '@react-spring/web';
import { TransitionProps } from '@mui/material/transitions';
import Box from '@mui/material/Box';
import Card from '@mui/material/Card';
Expand Down Expand Up @@ -81,17 +80,25 @@ function DotIcon({ color }: { color: string }) {
);
}

const AnimatedCollapse = animated(Collapse);

function TransitionComponent(props: TransitionProps) {
const style = useSpring({
to: {
opacity: props.in ? 1 : 0,
transform: `translate3d(0,${props.in ? 0 : 20}px,0)`,
},
});
const { in: inProp, children, ...rest } = props;

return <AnimatedCollapse style={style} {...props} />;
return (
<Collapse
{...rest}
in={inProp}
timeout={300}
sx={{
'& .collapse-content': {
opacity: inProp ? 1 : 0,
transform: `translateY(${inProp ? 0 : 20}px)`,
transition: 'opacity 300ms ease, transform 300ms ease',
},
}}
>
<Box className="collapse-content">{children}</Box>
</Collapse>
);
}

interface CustomLabelProps {
Expand Down
1 change: 0 additions & 1 deletion examples/core/auth-nextjs-themed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"@mui/x-data-grid": "^8",
"dayjs": "^1",
"clsx": "^2",
"@react-spring/web": "^9",
"@toolpad/core": "^0.14.0",
"next": "^15",
"next-auth": "^5.0.0-beta.25",
Expand Down