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
d300db66
Unverified
Commit
d300db66
authored
Apr 03, 2023
by
eddie
Committed by
GitHub
Apr 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: z index issue with socks icon (#6295)
parent
fb8217dd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
158 additions
and
2 deletions
+158
-2
package.json
package.json
+3
-0
StatusIcon.test.tsx
src/components/Identicon/StatusIcon.test.tsx
+24
-0
StatusIcon.tsx
src/components/Identicon/StatusIcon.tsx
+2
-2
StatusIcon.test.tsx.snap
...mponents/Identicon/__snapshots__/StatusIcon.test.tsx.snap
+129
-0
No files found.
package.json
View file @
d300db66
...
...
@@ -39,6 +39,9 @@
"src/state/**/*.ts*"
,
"src/utils/**/*.ts*"
],
"coveragePathIgnorePatterns"
:
[
".snap"
],
"coverageThreshold"
:
{
"global"
:
{
"branches"
:
4
,
...
...
src/components/Identicon/StatusIcon.test.tsx
0 → 100644
View file @
d300db66
import
{
getConnections
}
from
'
connection
'
import
{
render
}
from
'
test-utils
'
import
StatusIcon
from
'
./StatusIcon
'
jest
.
mock
(
'
../../hooks/useSocksBalance
'
,
()
=>
({
useHasSocks
:
()
=>
true
,
}))
describe
(
'
StatusIcon
'
,
()
=>
{
it
(
'
renders children in correct order, with no account and with socks
'
,
()
=>
{
const
supportedConnections
=
getConnections
()
const
injectedConnection
=
supportedConnections
[
1
]
const
component
=
render
(<
StatusIcon
connection=
{
injectedConnection
}
/>)
expect
(
component
.
getByTestId
(
'
StatusIconRoot
'
)).
toMatchSnapshot
()
})
it
(
'
renders with no account and showMiniIcons=false
'
,
()
=>
{
const
supportedConnections
=
getConnections
()
const
injectedConnection
=
supportedConnections
[
1
]
const
component
=
render
(<
StatusIcon
connection=
{
injectedConnection
}
showMiniIcons=
{
false
}
/>)
expect
(
component
.
getByTestId
(
'
StatusIconRoot
'
).
children
.
length
).
toEqual
(
0
)
})
})
src/components/Identicon/StatusIcon.tsx
View file @
d300db66
...
...
@@ -90,10 +90,10 @@ export default function StatusIcon({
const
hasSocks
=
useHasSocks
()
return
(
<
IconWrapper
size=
{
size
}
>
{
hasSocks
&&
showMiniIcons
&&
<
Socks
/>
}
<
IconWrapper
size=
{
size
}
data
-
testid=
"StatusIconRoot"
>
<
MainWalletIcon
connection=
{
connection
}
size=
{
size
}
/>
{
showMiniIcons
&&
<
MiniWalletIcon
connection=
{
connection
}
side=
"right"
/>
}
{
hasSocks
&&
showMiniIcons
&&
<
Socks
/>
}
</
IconWrapper
>
)
}
src/components/Identicon/__snapshots__/StatusIcon.test.tsx.snap
0 → 100644
View file @
d300db66
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`StatusIcon renders children in correct order, with no account and with socks 1`] = `
.c0 {
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-flow: column nowrap;
-ms-flex-flow: column nowrap;
flex-flow: column nowrap;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
margin-right: 8px;
}
.c0 > img,
.c0 span {
height: 16px;
width: 16px;
}
.c1 {
position: absolute;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 16px;
height: 16px;
bottom: -4px;
right: -4px;
border-radius: 50%;
outline: 2px solid #FFFFFF;
outline-offset: -0.1px;
background-color: #FFFFFF;
overflow: hidden;
}
.c3 {
position: absolute;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 16px;
height: 16px;
bottom: -4px;
left: -4px;
border-radius: 50%;
outline: 2px solid #FFFFFF;
outline-offset: -0.1px;
background-color: #FFFFFF;
overflow: hidden;
}
.c2 {
width: 16px;
height: 16px;
}
@media (max-width:960px) {
.c0 {
-webkit-align-items: flex-end;
-webkit-box-align: flex-end;
-ms-flex-align: flex-end;
align-items: flex-end;
}
}
@supports (overflow:clip) {
.c1 {
overflow: clip;
}
}
@supports (overflow:clip) {
.c3 {
overflow: clip;
}
}
<div
class="c0"
data-testid="StatusIconRoot"
size="16"
>
<div
class="c1"
>
<img
alt="MetaMask icon"
class="c2"
src="metamask.svg"
/>
</div>
<div
class="c3"
>
<img
class="c2"
src="socks.svg"
/>
</div>
</div>
`;
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