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
b4e981b2
Unverified
Commit
b4e981b2
authored
Feb 02, 2023
by
eddie
Committed by
GitHub
Feb 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: landing page styling of widget (#5917)
parent
967a6981
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
7 deletions
+33
-7
index.tsx
src/pages/Landing/index.tsx
+33
-7
No files found.
src/pages/Landing/index.tsx
View file @
b4e981b2
...
...
@@ -6,6 +6,7 @@ import Card, { CardType } from 'components/About/Card'
import
{
MAIN_CARDS
,
MORE_CARDS
}
from
'
components/About/constants
'
import
ProtocolBanner
from
'
components/About/ProtocolBanner
'
import
{
BaseButton
}
from
'
components/Button
'
import
{
useSwapWidgetEnabled
}
from
'
featureFlags/flags/swapWidget
'
import
Swap
from
'
pages/Swap
'
import
{
parse
}
from
'
qs
'
import
{
useEffect
,
useRef
,
useState
}
from
'
react
'
...
...
@@ -14,7 +15,7 @@ import { useLocation, useNavigate } from 'react-router-dom'
import
{
Link
as
NativeLink
}
from
'
react-router-dom
'
import
{
useAppSelector
}
from
'
state/hooks
'
import
{
useIsDarkMode
}
from
'
state/user/hooks
'
import
styled
from
'
styled-components/macro
'
import
styled
,
{
css
}
from
'
styled-components/macro
'
import
{
BREAKPOINTS
}
from
'
theme
'
import
{
Z_INDEX
}
from
'
theme/zIndex
'
...
...
@@ -255,25 +256,42 @@ const LandingSwapContainer = styled.div`
display: flex;
flex-direction: column;
align-items: center;
z-index: 1;
`
const
LandingSwap
=
styled
(
Swap
)
`
const
SwapCss
=
css
`
* {
pointer-events: none;
}
&:hover {
border: 1px solid
${({
theme
})
=>
theme
.
accentAction
}
;
transform: translateY(-4px);
transition:
${({
theme
})
=>
`transform
${
theme
.
transition
.
duration
.
medium
}
${
theme
.
transition
.
timing
.
ease
}
`
}
;
}
`
const
Link
=
styled
(
NativeLink
)
`
const
Link
Css
=
css
`
text-decoration: none;
max-width: 480px;
width: 100%;
`
const
LandingSwap
=
styled
(
Swap
)
`
${
SwapCss
}
&:hover {
border: 1px solid
${({
theme
})
=>
theme
.
accentAction
}
;
}
`
const
Link
=
styled
(
NativeLink
)
`
${
LinkCss
}
`
const
WidgetLandingLink
=
styled
(
NativeLink
)
`
${
LinkCss
}
${
SwapCss
}
`
export
default
function
Landing
()
{
const
isDarkMode
=
useIsDarkMode
()
...
...
@@ -287,6 +305,8 @@ export default function Landing() {
ignoreQueryPrefix
:
true
,
})
const
swapWidgetEnabled
=
useSwapWidgetEnabled
()
// This can be simplified significantly once the flag is removed! For now being explicit is clearer.
useEffect
(()
=>
{
if
(
queryParams
.
intro
||
!
selectedWallet
)
{
...
...
@@ -306,9 +326,15 @@ export default function Landing() {
name=
{
SharedEventName
.
ELEMENT_CLICKED
}
element=
{
InterfaceElementName
.
LANDING_PAGE_SWAP_ELEMENT
}
>
{
swapWidgetEnabled
?
(
<
WidgetLandingLink
to=
"/swap"
>
<
Swap
/>
</
WidgetLandingLink
>
)
:
(
<
Link
to=
"/swap"
>
<
LandingSwap
/>
</
Link
>
)
}
</
TraceEvent
>
</
LandingSwapContainer
>
<
Gradient
isDarkMode=
{
isDarkMode
}
/>
...
...
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