We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'use client';
import { usePathname } from "next/navigation"; import { TransitionGroup, CSSTransition } from 'react-transition-group'; import classNames from "classnames"; import './index.scss';
export default function Translation({ children }: { children: React.ReactNode }) {
const pathname = usePathname(); const router = useCustomRouter();
return ( <> <div style={{ height: pathname === '/login' ? 396 : 415 }} className="animation"> <TransitionGroup className={classNames('transition')}> {children} // This is the route </> ) }
index.scss
.animation { position: relative; overflow: hidden; transition: height 400ms ease; }
.transition>* { top: 0; left: 0; width: 100%; position: absolute; }
.page-transition-enter, .page-transition-appear { transform: translateX(100%); transition: none; }
.return .page-transition-enter, .return .page-transition-appear { transform: translateX(-100%); }
.page-transition-enter-active, .page-transition-appear-active { transform: translateX(0%) !important; transition: all 400ms cubic-bezier(0.25, 0, 0, 1); }
.page-transition-exit { transform: translateX(0); transition: none; }
.page-transition-exit-active { transform: translateX(-100%); transition: all 400ms cubic-bezier(0.25, 0, 0, 1); }
.return .page-transition-exit-active { transform: translateX(100%); transition: all 400ms cubic-bezier(0.25, 0, 0, 1); } }
Run the code above to see the results,Can you see if there's a configuration wrong?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
'use client';
import { usePathname } from "next/navigation";
import { TransitionGroup, CSSTransition } from 'react-transition-group';
import classNames from "classnames";
import './index.scss';
export default function Translation({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
const router = useCustomRouter();
return (
<>
<div style={{ height: pathname === '/login' ? 396 : 415 }} className="animation">
<TransitionGroup className={classNames('transition')}>
{children} // This is the route
</>
)
}
index.scss
.animation {
position: relative;
overflow: hidden;
transition: height 400ms ease;
}
.transition>* {
top: 0;
left: 0;
width: 100%;
position: absolute;
}
.page-transition-enter,
.page-transition-appear {
transform: translateX(100%);
transition: none;
}
.return .page-transition-enter,
.return .page-transition-appear {
transform: translateX(-100%);
}
.page-transition-enter-active,
.page-transition-appear-active {
transform: translateX(0%) !important;
transition: all 400ms cubic-bezier(0.25, 0, 0, 1);
}
.page-transition-exit {
transform: translateX(0);
transition: none;
}
.page-transition-exit-active {
transform: translateX(-100%);
transition: all 400ms cubic-bezier(0.25, 0, 0, 1);
}
.return .page-transition-exit-active {
transform: translateX(100%);
transition: all 400ms cubic-bezier(0.25, 0, 0, 1);
}
}
Run the code above to see the results,Can you see if there's a configuration wrong?
The text was updated successfully, but these errors were encountered: