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
d3cbcc76
Unverified
Commit
d3cbcc76
authored
Nov 01, 2022
by
lynn
Committed by
GitHub
Nov 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove radial gradient background effect from nft pages (#5057)
init
parent
ab43800d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
RadialGradientByChainUpdater.ts
src/theme/RadialGradientByChainUpdater.ts
+14
-1
No files found.
src/theme/RadialGradientByChainUpdater.ts
View file @
d3cbcc76
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
useEffect
}
from
'
react
'
import
{
useEffect
}
from
'
react
'
import
{
useLocation
}
from
'
react-router-dom
'
import
{
useDarkModeManager
}
from
'
state/user/hooks
'
import
{
useDarkModeManager
}
from
'
state/user/hooks
'
import
{
SupportedChainId
}
from
'
../constants/chains
'
import
{
SupportedChainId
}
from
'
../constants/chains
'
import
{
colorsDark
,
colorsLight
}
from
'
./colors
'
const
initialStyles
=
{
const
initialStyles
=
{
width
:
'
200vw
'
,
width
:
'
200vw
'
,
...
@@ -27,12 +29,23 @@ const setBackground = (newValues: TargetBackgroundStyles) =>
...
@@ -27,12 +29,23 @@ const setBackground = (newValues: TargetBackgroundStyles) =>
export
default
function
RadialGradientByChainUpdater
():
null
{
export
default
function
RadialGradientByChainUpdater
():
null
{
const
{
chainId
}
=
useWeb3React
()
const
{
chainId
}
=
useWeb3React
()
const
[
darkMode
]
=
useDarkModeManager
()
const
[
darkMode
]
=
useDarkModeManager
()
const
{
pathname
}
=
useLocation
()
const
isNftPage
=
pathname
.
startsWith
(
'
/nfts
'
)
||
pathname
.
startsWith
(
'
/profile
'
)
// manage background color
// manage background color
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
backgroundRadialGradientElement
)
{
if
(
!
backgroundRadialGradientElement
)
{
return
return
}
}
if
(
isNftPage
)
{
setBackground
(
initialStyles
)
backgroundRadialGradientElement
.
style
.
background
=
darkMode
?
colorsDark
.
backgroundBackdrop
:
colorsLight
.
backgroundBackdrop
return
}
switch
(
chainId
)
{
switch
(
chainId
)
{
case
SupportedChainId
.
ARBITRUM_ONE
:
case
SupportedChainId
.
ARBITRUM_ONE
:
case
SupportedChainId
.
ARBITRUM_RINKEBY
:
case
SupportedChainId
.
ARBITRUM_RINKEBY
:
...
@@ -77,6 +90,6 @@ export default function RadialGradientByChainUpdater(): null {
...
@@ -77,6 +90,6 @@ export default function RadialGradientByChainUpdater(): null {
const
defaultDarkGradient
=
'
linear-gradient(180deg, #202738 0%, #070816 100%)
'
const
defaultDarkGradient
=
'
linear-gradient(180deg, #202738 0%, #070816 100%)
'
backgroundRadialGradientElement
.
style
.
background
=
darkMode
?
defaultDarkGradient
:
defaultLightGradient
backgroundRadialGradientElement
.
style
.
background
=
darkMode
?
defaultDarkGradient
:
defaultLightGradient
}
}
},
[
darkMode
,
chainId
])
},
[
darkMode
,
chainId
,
isNftPage
])
return
null
return
null
}
}
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