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
7b6ac6cf
Unverified
Commit
7b6ac6cf
authored
Sep 30, 2022
by
lynn
Committed by
GitHub
Sep 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update network warning styling (#4767)
* init * respond to cmcewen comments
parent
8a9ade5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
ChainConnectivityWarning.tsx
src/components/Header/ChainConnectivityWarning.tsx
+26
-16
No files found.
src/components/Header/ChainConnectivityWarning.tsx
View file @
7b6ac6cf
...
@@ -2,17 +2,25 @@ import { Trans } from '@lingui/macro'
...
@@ -2,17 +2,25 @@ import { Trans } from '@lingui/macro'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
getChainInfoOrDefault
,
L2ChainInfo
}
from
'
constants/chainInfo
'
import
{
getChainInfoOrDefault
,
L2ChainInfo
}
from
'
constants/chainInfo
'
import
{
SupportedChainId
}
from
'
constants/chains
'
import
{
SupportedChainId
}
from
'
constants/chains
'
import
{
AlertOctagon
}
from
'
react-feather
'
import
{
RedesignVariant
,
useRedesignFlag
}
from
'
featureFlags/flags/redesign
'
import
{
AlertOctagon
,
AlertTriangle
}
from
'
react-feather
'
import
styled
from
'
styled-components/macro
'
import
styled
from
'
styled-components/macro
'
import
{
ExternalLink
,
MEDIA_WIDTHS
}
from
'
theme
'
import
{
ExternalLink
,
MEDIA_WIDTHS
}
from
'
theme
'
const
BodyRow
=
styled
.
div
`
const
BodyRow
=
styled
.
div
<
{
$redesignFlag
?:
boolean
}
>
`
color:
${({
theme
})
=>
theme
.
deprecated_black
}
;
color:
${({
theme
,
$redesignFlag
})
=>
(
$redesignFlag
?
theme
.
textPrimary
:
theme
.
black
)
}
;
font-size: 12px;
font-size: 12px;
font-weight:
${({
$redesignFlag
})
=>
$redesignFlag
&&
'
400
'
}
;
font-size:
${({
$redesignFlag
})
=>
(
$redesignFlag
?
'
14px
'
:
'
12px
'
)}
;
line-height:
${({
$redesignFlag
})
=>
$redesignFlag
&&
'
20px
'
}
;
`
`
const
Caution
Ic
on
=
styled
(
AlertOctagon
)
`
const
Caution
Octag
on
=
styled
(
AlertOctagon
)
`
color:
${({
theme
})
=>
theme
.
deprecated_black
}
;
color:
${({
theme
})
=>
theme
.
deprecated_black
}
;
`
`
const
CautionTriangle
=
styled
(
AlertTriangle
)
`
color:
${({
theme
})
=>
theme
.
accentWarning
}
;
`
const
Link
=
styled
(
ExternalLink
)
`
const
Link
=
styled
(
ExternalLink
)
`
color:
${({
theme
})
=>
theme
.
deprecated_black
}
;
color:
${({
theme
})
=>
theme
.
deprecated_black
}
;
text-decoration: underline;
text-decoration: underline;
...
@@ -23,21 +31,22 @@ const TitleRow = styled.div`
...
@@ -23,21 +31,22 @@ const TitleRow = styled.div`
justify-content: flex-start;
justify-content: flex-start;
margin-bottom: 8px;
margin-bottom: 8px;
`
`
const
TitleText
=
styled
.
div
`
const
TitleText
=
styled
.
div
<
{
redesignFlag
?:
boolean
}
>
`
color:
black
;
color:
${({
theme
,
redesignFlag
})
=>
(
redesignFlag
?
theme
.
textPrimary
:
theme
.
black
)}
;
font-weight:
600
;
font-weight:
${({
redesignFlag
})
=>
(
redesignFlag
?
'
500
'
:
'
600
'
)}
;
font-size: 16px;
font-size: 16px;
line-height:
20px
;
line-height:
${({
redesignFlag
})
=>
(
redesignFlag
?
'
24px
'
:
'
20px
'
)}
;
margin: 0px 12px;
margin: 0px 12px;
`
`
const
Wrapper
=
styled
.
div
`
const
Wrapper
=
styled
.
div
<
{
redesignFlag
?:
boolean
}
>
`
background-color:
${({
theme
})
=>
theme
.
deprecated_yellow3
}
;
background-color:
${({
theme
,
redesignFlag
})
=>
(
redesignFlag
?
theme
.
backgroundSurface
:
theme
.
deprecated_yellow3
)
}
;
border-radius: 12px;
border-radius: 12px;
border: 1px solid
${({
theme
})
=>
theme
.
backgroundOutline
}
;
bottom: 60px;
bottom: 60px;
display: none;
display: none;
max-width: 348px;
max-width: 348px;
padding: 16px 20px;
padding: 16px 20px;
position:
absolute
;
position:
fixed
;
right: 16px;
right: 16px;
@media screen and (min-width:
${
MEDIA_WIDTHS
.
deprecated_upToMedium
}
px) {
@media screen and (min-width:
${
MEDIA_WIDTHS
.
deprecated_upToMedium
}
px) {
display: block;
display: block;
...
@@ -48,20 +57,21 @@ export function ChainConnectivityWarning() {
...
@@ -48,20 +57,21 @@ export function ChainConnectivityWarning() {
const
{
chainId
}
=
useWeb3React
()
const
{
chainId
}
=
useWeb3React
()
const
info
=
getChainInfoOrDefault
(
chainId
)
const
info
=
getChainInfoOrDefault
(
chainId
)
const
label
=
info
?.
label
const
label
=
info
?.
label
const
redesignFlag
=
useRedesignFlag
()
===
RedesignVariant
.
Enabled
return
(
return
(
<
Wrapper
>
<
Wrapper
redesignFlag=
{
redesignFlag
}
>
<
TitleRow
>
<
TitleRow
>
<
CautionIcon
/>
{
redesignFlag
?
<
CautionTriangle
/>
:
<
CautionOctagon
/>
}
<
TitleText
>
<
TitleText
redesignFlag=
{
redesignFlag
}
>
<
Trans
>
Network Warning
</
Trans
>
<
Trans
>
Network Warning
</
Trans
>
</
TitleText
>
</
TitleText
>
</
TitleRow
>
</
TitleRow
>
<
BodyRow
>
<
BodyRow
$redesignFlag=
{
redesignFlag
}
>
{
chainId
===
SupportedChainId
.
MAINNET
?
(
{
chainId
===
SupportedChainId
.
MAINNET
?
(
<
Trans
>
You may have lost your network connection.
</
Trans
>
<
Trans
>
You may have lost your network connection.
</
Trans
>
)
:
(
)
:
(
<
Trans
>
You may have lost your network connection, or
{
label
}
might be down right now
.
</
Trans
>
<
Trans
>
{
label
}
might be down right now, or you may have lost your network connection
.
</
Trans
>
)
}{
'
'
}
)
}{
'
'
}
{
(
info
as
L2ChainInfo
).
statusPage
!==
undefined
&&
(
{
(
info
as
L2ChainInfo
).
statusPage
!==
undefined
&&
(
<
span
>
<
span
>
...
...
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