I am quite new to React. I've created a sidebar component. The problem is that I am unable to make animation working well for moving the close menu icon to the left. What I expect is that the menu icon move to the left same with the whole sidebar when I click the close menu icon.
In my css, i add a class to the close menu icon, but no animation works
.user-sidebar-menu-icon-times {
transform: translateX(0px);
}
.user-sidebar-menu-icon-times.moveleft {
transform: translateX(-500px);
}
and some click handler controlling the toggle
{this.state.isClicked ? (
<FaBars className="user-sidebar-menu-icon-bars" />
) : this.state.isShow ? (
<FaTimes className="user-sidebar-menu-icon-times moveleft" />
) : (
<FaTimes className="user-sidebar-menu-icon-times" />
)}
Here is the sandbox link showing my problem: https://codesandbox.io/s/adoring-greider-iss80?file=/src/components/Sidebar/Sidebar.js
Any help is highly appreciated!