Skip to content

Commit 126ecc7

Browse files
committed
Change animation when redirect is from DirectMessageForm.js, remove unnecessary comment
1 parent c8c3d8f commit 126ecc7

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/pages/App.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ import Sidebar from "../layout/Sidebar/Sidebar";
2929
import Navigation from "./Navigation/Navigation";
3030
import SplashingScreen from "../layout/SplashingScreen/SplashingScreen";
3131

32-
// import SideDrawer from "../layout/SideDrawer/SideDrawer";
33-
3432
// Actions
3533
import { loadUser } from "../actions/auth-actions";
3634

@@ -83,11 +81,21 @@ function AuthorizedRoutes() {
8381
// Transition animation
8482
// eslint-disable-next-line no-shadow
8583
const transitions = useTransition(location, (location) => location.pathname, {
86-
from: {
87-
opacity: 0,
88-
transform: "scale(0.9)",
89-
width: "100%",
90-
height: "100%",
84+
from: (item) => {
85+
if (item?.state?.fromCreateDm) {
86+
return {
87+
opacity: 1,
88+
transform: "scale(1)",
89+
width: "100%",
90+
height: "100%",
91+
};
92+
}
93+
return {
94+
opacity: 0,
95+
transform: "scale(0.9)",
96+
width: "100%",
97+
height: "100%",
98+
};
9199
},
92100
enter: {
93101
opacity: 1,

0 commit comments

Comments
 (0)