@@ -18,6 +18,7 @@ import { useEffect, useState } from 'react'
18
18
import { Redirect , Route , Switch , useHistory , useLocation } from 'react-router-dom'
19
19
20
20
import {
21
+ AnimatePresence ,
21
22
Button ,
22
23
ButtonComponentType ,
23
24
ButtonStyleType ,
@@ -27,6 +28,7 @@ import {
27
28
Host ,
28
29
Icon ,
29
30
LoginBanner ,
31
+ MotionDiv ,
30
32
SSOProviderIcon ,
31
33
ToastManager ,
32
34
ToastVariantType ,
@@ -40,7 +42,7 @@ import { importComponentFromFELibrary } from '@Components/common'
40
42
import { TOKEN_COOKIE_NAME , URLS } from '../../config'
41
43
import { getSSOConfigList } from '../../Pages/GlobalConfigurations/Authorization/SSOLoginServices/service'
42
44
import { dashboardAccessed } from '../../services/service'
43
- import { SSOProvider } from './constants'
45
+ import { ANIMATION_VARIANTS , SSOProvider } from './constants'
44
46
import { SSOConfigLoginList } from './login.types'
45
47
import { LoginForm } from './LoginForm'
46
48
@@ -171,7 +173,7 @@ const Login = () => {
171
173
)
172
174
173
175
const renderLoginContent = ( ) => (
174
- < Switch >
176
+ < Switch location = { location } >
175
177
< Route path = { URLS . LOGIN_SSO } component = { renderSSOLoginPage } />
176
178
< Route path = { URLS . LOGIN_ADMIN } component = { renderAdminLoginPage } />
177
179
< Redirect to = { URLS . LOGIN_SSO } />
@@ -187,7 +189,20 @@ const Login = () => {
187
189
< div className = "login-card__wrapper dc__overflow-hidden br-12 mw-420 bg__primary dc__border" >
188
190
< div className = "flexbox-col" >
189
191
{ renderDevtronLogo ( ) }
190
- { renderLoginContent ( ) }
192
+ { /* do we need initial */ }
193
+ < AnimatePresence initial = { false } >
194
+ < MotionDiv
195
+ key = { location . pathname }
196
+ variants = { ANIMATION_VARIANTS }
197
+ initial = "initial"
198
+ animate = "animate"
199
+ exit = "exit"
200
+ transition = { { duration : 0.25 , ease : 'easeInOut' } }
201
+ style = { { overflow : 'hidden' } }
202
+ >
203
+ { renderLoginContent ( ) }
204
+ </ MotionDiv >
205
+ </ AnimatePresence >
191
206
</ div >
192
207
{ getTermsAndConditions && getTermsAndConditions ( ) }
193
208
</ div >
0 commit comments