Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
a2c6d3f4
Unverified
Commit
a2c6d3f4
authored
Dec 19, 2022
by
Vignesh Mohankumar
Committed by
GitHub
Dec 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: navigate to /swap if user has a wallet cached (#5728)
* feat: navigate to /swap if user has a wallet cached * flag it
parent
804692b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
index.tsx
src/pages/Landing/index.tsx
+12
-1
No files found.
src/pages/Landing/index.tsx
View file @
a2c6d3f4
import
{
Trace
,
TraceEvent
}
from
'
@uniswap/analytics
'
import
{
Trace
,
TraceEvent
}
from
'
@uniswap/analytics
'
import
{
BrowserEvent
,
ElementName
,
EventName
,
PageName
}
from
'
@uniswap/analytics-events
'
import
{
BrowserEvent
,
ElementName
,
EventName
,
PageName
}
from
'
@uniswap/analytics-events
'
import
{
BaseButton
}
from
'
components/Button
'
import
{
BaseButton
}
from
'
components/Button
'
import
{
LandingRedirectVariant
,
useLandingRedirectFlag
}
from
'
featureFlags/flags/landingRedirect
'
import
Swap
from
'
pages/Swap
'
import
Swap
from
'
pages/Swap
'
import
{
useEffect
}
from
'
react
'
import
{
useEffect
}
from
'
react
'
import
{
useLocation
}
from
'
react-router-dom
'
import
{
useLocation
,
useNavigate
}
from
'
react-router-dom
'
import
{
Link
as
NativeLink
}
from
'
react-router-dom
'
import
{
Link
as
NativeLink
}
from
'
react-router-dom
'
import
{
useAppSelector
}
from
'
state/hooks
'
import
{
useIsDarkMode
}
from
'
state/user/hooks
'
import
{
useIsDarkMode
}
from
'
state/user/hooks
'
import
styled
from
'
styled-components/macro
'
import
styled
from
'
styled-components/macro
'
import
{
BREAKPOINTS
}
from
'
theme
'
import
{
BREAKPOINTS
}
from
'
theme
'
...
@@ -176,6 +178,15 @@ export default function Landing() {
...
@@ -176,6 +178,15 @@ export default function Landing() {
}
}
},
[])
},
[])
const
selectedWallet
=
useAppSelector
((
state
)
=>
state
.
user
.
selectedWallet
)
const
landingRedirectFlag
=
useLandingRedirectFlag
()
const
navigate
=
useNavigate
()
useEffect
(()
=>
{
if
(
selectedWallet
&&
landingRedirectFlag
===
LandingRedirectVariant
.
Enabled
)
{
navigate
(
'
/swap
'
)
}
},
[
navigate
,
selectedWallet
,
landingRedirectFlag
])
if
(
!
isOpen
)
return
null
if
(
!
isOpen
)
return
null
return
(
return
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment