Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
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
vicotor
frontend
Commits
a1b70701
Commit
a1b70701
authored
Jun 04, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix multichain button for mobile
parent
5ea7590b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
19 deletions
+37
-19
AddressNetWorth.pw.tsx
ui/address/details/AddressNetWorth.pw.tsx
+16
-0
AddressNetWorth.tsx
ui/address/details/AddressNetWorth.tsx
+21
-19
AddressNetWorth.pw.tsx_dark-color-mode_with-multichain-button-internal-dark-mode-1.png
...olor-mode_with-multichain-button-internal-dark-mode-1.png
+0
-0
AddressNetWorth.pw.tsx_default_with-multichain-button-external-1.png
...orth.pw.tsx_default_with-multichain-button-external-1.png
+0
-0
AddressNetWorth.pw.tsx_default_with-multichain-button-internal-dark-mode-1.png
...x_default_with-multichain-button-internal-dark-mode-1.png
+0
-0
AddressNetWorth.pw.tsx_default_with-multichain-button-internal-small-screen-1.png
...efault_with-multichain-button-internal-small-screen-1.png
+0
-0
No files found.
ui/address/details/AddressNetWorth.pw.tsx
View file @
a1b70701
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
*
as
addressMock
from
'
mocks/address/address
'
;
...
...
@@ -45,3 +46,18 @@ test('with multichain button external', async({ render, mockEnvs, mockAssetRespo
await
expect
(
component
).
toHaveScreenshot
();
});
test
(
'
with multichain button internal small screen
'
,
async
({
render
,
mockEnvs
,
mockAssetResponse
})
=>
{
await
mockEnvs
([
[
'
NEXT_PUBLIC_MULTICHAIN_BALANCE_PROVIDER_CONFIG
'
,
`{"name": "duck", "dapp_id": "duck", "url_template": "https://duck.url/{address}", "logo": "
${
ICON_URL
}
"}`
],
]);
await
mockAssetResponse
(
ICON_URL
,
'
./playwright/mocks/image_svg.svg
'
);
const
component
=
await
render
(
<
Box
w=
"300px"
><
AddressNetWorth
addressData=
{
addressMock
.
token
}
addressHash=
{
ADDRESS_HASH
}
/></
Box
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
ui/address/details/AddressNetWorth.tsx
View file @
a1b70701
import
{
Image
,
Skeleton
,
Text
}
from
'
@chakra-ui/react
'
;
import
{
Image
,
Skeleton
,
Text
,
Flex
}
from
'
@chakra-ui/react
'
;
import
_capitalize
from
'
lodash/capitalize
'
;
import
React
from
'
react
'
;
...
...
@@ -75,23 +75,25 @@ const AddressNetWorth = ({ addressData, isLoading, addressHash }: Props) => {
const
dappId
=
multichainFeature
.
dappId
;
multichainItem
=
(
<>
<
TextSeparator
mx=
{
3
}
color=
"gray.500"
/>
<
Text
mr=
{
2
}
>
Multichain
</
Text
>
{
typeof
dappId
===
'
string
'
?
(
<
LinkInternal
href=
{
route
({
pathname
:
'
/apps/[id]
'
,
query
:
{
id
:
dappId
,
url
:
portfolioUrl
.
toString
()
}
})
}
{
...
linkProps
}
>
{
buttonContent
}
</
LinkInternal
>
)
:
(
<
LinkExternal
href=
{
portfolioUrl
.
toString
()
}
{
...
linkProps
}
>
{
buttonContent
}
</
LinkExternal
>
)
}
<
TextSeparator
mx=
{
0
}
color=
"gray.500"
/>
<
Flex
alignItems=
"center"
gap=
{
2
}
>
<
Text
>
Multichain
</
Text
>
{
typeof
dappId
===
'
string
'
?
(
<
LinkInternal
href=
{
route
({
pathname
:
'
/apps/[id]
'
,
query
:
{
id
:
dappId
,
url
:
portfolioUrl
.
toString
()
}
})
}
{
...
linkProps
}
>
{
buttonContent
}
</
LinkInternal
>
)
:
(
<
LinkExternal
href=
{
portfolioUrl
.
toString
()
}
{
...
linkProps
}
>
{
buttonContent
}
</
LinkExternal
>
)
}
</
Flex
>
</>
);
}
catch
(
error
)
{}
...
...
@@ -99,7 +101,7 @@ const AddressNetWorth = ({ addressData, isLoading, addressHash }: Props) => {
}
return
(
<
Skeleton
display=
"flex"
alignItems=
"center"
isLoaded=
{
!
isLoading
&&
!
(
addressData
?.
has_tokens
&&
isPending
)
}
>
<
Skeleton
display=
"flex"
alignItems=
"center"
flexWrap=
"wrap"
isLoaded=
{
!
isLoading
&&
!
(
addressData
?.
has_tokens
&&
isPending
)
}
gap=
{
2
}
>
<
Text
>
{
(
isError
||
!
addressData
?.
exchange_rate
)
?
'
N/A
'
:
`${ prefix }$${ totalUsd.toFormat(2) }`
}
</
Text
>
...
...
ui/address/details/__screenshots__/AddressNetWorth.pw.tsx_dark-color-mode_with-multichain-button-internal-dark-mode-1.png
View replaced file @
5ea7590b
View file @
a1b70701
5.63 KB
|
W:
|
H:
5.63 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/address/details/__screenshots__/AddressNetWorth.pw.tsx_default_with-multichain-button-external-1.png
View replaced file @
5ea7590b
View file @
a1b70701
5.55 KB
|
W:
|
H:
5.55 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/address/details/__screenshots__/AddressNetWorth.pw.tsx_default_with-multichain-button-internal-dark-mode-1.png
View replaced file @
5ea7590b
View file @
a1b70701
5.41 KB
|
W:
|
H:
5.4 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/address/details/__screenshots__/AddressNetWorth.pw.tsx_default_with-multichain-button-internal-small-screen-1.png
0 → 100644
View file @
a1b70701
5.86 KB
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