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
633f6567
Unverified
Commit
633f6567
authored
Jun 28, 2021
by
Moody Salem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(theme): fix the missing background radial gradient
fixes
https://github.com/Uniswap/uniswap-interface/issues/1925
parent
9bccb7ae
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
24 deletions
+27
-24
index.html
public/index.html
+1
-1
index.tsx
src/index.tsx
+2
-0
updater.ts
src/state/application/updater.ts
+2
-23
RadialGradientByChainUpdater.ts
src/theme/RadialGradientByChainUpdater.ts
+22
-0
No files found.
public/index.html
View file @
633f6567
...
...
@@ -63,9 +63,9 @@
pointer-events
:
none
;
width
:
200vw
;
height
:
200vh
;
mix-blend-mode
:
color
;
background
:
radial-gradient
(
50%
50%
at
50%
50%
,
#fc077d10
0%
,
rgba
(
255
,
255
,
255
,
0
)
100%
);
transform
:
translate
(
-50vw
,
-100vh
);
mix-blend-mode
:
color
;
z-index
:
-1
;
}
...
...
src/index.tsx
View file @
633f6567
...
...
@@ -19,6 +19,7 @@ import MulticallUpdater from './state/multicall/updater'
import
TransactionUpdater
from
'
./state/transactions/updater
'
import
UserUpdater
from
'
./state/user/updater
'
import
ThemeProvider
,
{
ThemedGlobalStyle
}
from
'
./theme
'
import
RadialGradientByChainUpdater
from
'
./theme/RadialGradientByChainUpdater
'
import
getLibrary
from
'
./utils/getLibrary
'
const
Web3ProviderNetwork
=
createWeb3ReactRoot
(
NetworkContextName
)
...
...
@@ -50,6 +51,7 @@ if (typeof GOOGLE_ANALYTICS_ID === 'string') {
function
Updaters
()
{
return
(
<>
<
RadialGradientByChainUpdater
/>
<
ListsUpdater
/>
<
UserUpdater
/>
<
ApplicationUpdater
/>
...
...
src/state/application/updater.ts
View file @
633f6567
import
{
useCallback
,
useEffect
,
useState
}
from
'
react
'
import
{
useA
ctiveWeb3React
}
from
'
../../hooks/web3
'
import
{
useA
ppDispatch
}
from
'
state/hooks
'
import
useDebounce
from
'
../../hooks/useDebounce
'
import
useIsWindowVisible
from
'
../../hooks/useIsWindowVisible
'
import
{
useActiveWeb3React
}
from
'
../../hooks/web3
'
import
{
updateBlockNumber
}
from
'
./actions
'
import
{
useAppDispatch
}
from
'
state/hooks
'
import
{
SupportedChainId
}
from
'
constants/chains
'
export
default
function
Updater
():
null
{
const
{
library
,
chainId
}
=
useActiveWeb3React
()
...
...
@@ -54,25 +53,5 @@ export default function Updater(): null {
dispatch
(
updateBlockNumber
({
chainId
:
debouncedState
.
chainId
,
blockNumber
:
debouncedState
.
blockNumber
}))
},
[
windowVisible
,
dispatch
,
debouncedState
.
blockNumber
,
debouncedState
.
chainId
])
// manage background color
const
background
=
document
.
getElementById
(
'
background-radial-gradient
'
)
useEffect
(()
=>
{
if
(
!
background
)
{
return
}
let
gradient
switch
(
chainId
)
{
case
SupportedChainId
.
ARBITRUM_ONE
:
gradient
=
'
radial-gradient(96.19% 96.19% at 50% -5.43%, hsla(204, 87%, 55%, 0.2) 0%, hsla(227, 0%, 0%, 0) 100%)
'
break
default
:
gradient
=
'
radial-gradient(50% 50% at 50% 50%, #fc077d10 0%, rgba(255, 255, 255, 0) 100%)
'
}
background
.
style
.
background
=
gradient
},
[
background
,
chainId
])
return
null
}
src/theme/RadialGradientByChainUpdater.ts
0 → 100644
View file @
633f6567
import
{
useEffect
}
from
'
react
'
import
{
SupportedChainId
}
from
'
../constants/chains
'
import
{
useActiveWeb3React
}
from
'
../hooks/web3
'
const
backgroundRadialGradientElement
=
document
.
getElementById
(
'
background-radial-gradient
'
)
export
default
function
RadialGradientByChainUpdater
():
null
{
const
{
chainId
}
=
useActiveWeb3React
()
// manage background color
useEffect
(()
=>
{
if
(
!
backgroundRadialGradientElement
)
{
return
}
if
(
chainId
===
SupportedChainId
.
ARBITRUM_ONE
)
{
backgroundRadialGradientElement
.
style
.
background
=
'
radial-gradient(96.19% 96.19% at 50% -5.43%, hsla(204, 87%, 55%, 0.2) 0%, hsla(227, 0%, 0%, 0) 100%)
'
}
else
{
backgroundRadialGradientElement
.
style
.
background
=
''
}
},
[
chainId
])
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