I want a component to perform the slide animation to the right when it is mounted, and to the left when it is unmounted, all using the div belonging to the "profile-slide-container" class as the container of the Slide component, but I have no idea how to do it.
Here is the code:
function Main(){
const [showProfileMenu, setShowProfileMenu] = useState(false);
return(
<div className="main">
<Header />
<div className="profile-slide-container">
{showProfileMenu && <Slide in={true} direction={"right"}><div className="pseudo-left-section"><ProfileMenu onClick={() => setShowProfileMenu(false)} /></div></Slide>}
</div>
<div className="left-section">
<div>
<LeftSectionHeader onClick={() => setShowProfileMenu(true)} />
<LangMenu />
</div>
</div>
</div>
);
}