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
ae0debf5
Commit
ae0debf5
authored
Feb 12, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interpretation UI update
parent
e7a9bc6a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
5 deletions
+26
-5
nextjs-routes.d.ts
nextjs/nextjs-routes.d.ts
+1
-1
TxSubHeading.pw.tsx
ui/tx/TxSubHeading.pw.tsx
+15
-0
TxSubHeading.tsx
ui/tx/TxSubHeading.tsx
+6
-2
TxSubHeading.pw.tsx_default_with-interpretation-and-view-all-link-mobile-1.png
...efault_with-interpretation-and-view-all-link-mobile-1.png
+0
-0
TxSubHeading.pw.tsx_mobile_with-interpretation-and-view-all-link-mobile-1.png
...mobile_with-interpretation-and-view-all-link-mobile-1.png
+0
-0
TxInterpretation.tsx
ui/tx/interpretation/TxInterpretation.tsx
+4
-2
No files found.
nextjs/nextjs-routes.d.ts
View file @
ae0debf5
...
...
@@ -38,9 +38,9 @@ declare module "nextjs-routes" {
|
StaticRoute
<
"
/login
"
>
|
DynamicRoute
<
"
/name-domains/[name]
"
,
{
"
name
"
:
string
}
>
|
StaticRoute
<
"
/name-domains
"
>
|
StaticRoute
<
"
/output-roots
"
>
|
DynamicRoute
<
"
/op/[hash]
"
,
{
"
hash
"
:
string
}
>
|
StaticRoute
<
"
/ops
"
>
|
StaticRoute
<
"
/output-roots
"
>
|
StaticRoute
<
"
/search-results
"
>
|
StaticRoute
<
"
/stats
"
>
|
DynamicRoute
<
"
/token/[hash]
"
,
{
"
hash
"
:
string
}
>
...
...
ui/tx/TxSubHeading.pw.tsx
View file @
ae0debf5
...
...
@@ -43,6 +43,21 @@ bsInterpretationTest('with interpretation +@mobile +@dark-mode', async({ mount,
await
expect
(
component
).
toHaveScreenshot
();
});
bsInterpretationTest
(
'
with interpretation and view all link +@mobile
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
TX_INTERPRETATION_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
({
data
:
{
summaries
:
[
...
txInterpretation
.
data
.
summaries
,
...
txInterpretation
.
data
.
summaries
]
}
}),
}));
const
component
=
await
mount
(
<
TestApp
>
<
TxSubHeading
hash=
{
hash
}
hasTag=
{
false
}
/>
</
TestApp
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
bsInterpretationTest
(
'
no interpretation
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
TX_INTERPRETATION_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
...
...
ui/tx/TxSubHeading.tsx
View file @
ae0debf5
...
...
@@ -29,6 +29,9 @@ const TxSubHeading = ({ hash, hasTag }: Props) => {
const
hasInterpretation
=
hasInterpretationFeature
&&
(
txInterpretationQuery
.
isPlaceholderData
||
Boolean
(
txInterpretationQuery
.
data
?.
data
.
summaries
.
length
));
const
hasViewAllInterpretationsLink
=
!
txInterpretationQuery
.
isPlaceholderData
&&
txInterpretationQuery
.
data
?.
data
.
summaries
&&
txInterpretationQuery
.
data
?.
data
.
summaries
.
length
>
1
;
return
(
<
Box
display=
{
{
base
:
'
block
'
,
lg
:
'
flex
'
}
}
alignItems=
"center"
w=
"100%"
>
{
hasInterpretation
&&
(
...
...
@@ -37,9 +40,10 @@ const TxSubHeading = ({ hash, hasTag }: Props) => {
summary=
{
txInterpretationQuery
.
data
?.
data
.
summaries
[
0
]
}
isLoading=
{
txInterpretationQuery
.
isPlaceholderData
}
fontSize=
"lg"
mr=
{
hasViewAllInterpretationsLink
?
3
:
0
}
/>
{
!
txInterpretationQuery
.
isPlaceholderData
&&
txInterpretationQuery
.
data
?.
data
.
summaries
&&
txInterpretationQuery
.
data
?.
data
.
summaries
.
length
>
1
&&
<
Link
ml=
{
3
}
href=
{
`#${ TX_ACTIONS_BLOCK_ID }`
}
>
all actions
</
Link
>
}
{
hasViewAllInterpretationsLink
&&
<
Link
href=
{
`#${ TX_ACTIONS_BLOCK_ID }`
}
>
View all
</
Link
>
}
</
Flex
>
)
}
{
!
hasInterpretation
&&
<
TxEntity
hash=
{
hash
}
noLink
noCopy=
{
false
}
fontWeight=
{
500
}
mr=
{
{
base
:
0
,
lg
:
2
}
}
fontFamily=
"heading"
/>
}
...
...
ui/tx/__screenshots__/TxSubHeading.pw.tsx_default_with-interpretation-and-view-all-link-mobile-1.png
0 → 100644
View file @
ae0debf5
11.1 KB
ui/tx/__screenshots__/TxSubHeading.pw.tsx_mobile_with-interpretation-and-view-all-link-mobile-1.png
0 → 100644
View file @
ae0debf5
10.7 KB
ui/tx/interpretation/TxInterpretation.tsx
View file @
ae0debf5
import
{
Skeleton
,
chakra
}
from
'
@chakra-ui/react
'
;
import
{
Skeleton
,
Tooltip
,
chakra
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
...
...
@@ -127,7 +127,9 @@ const TxInterpretation = ({ summary, isLoading, className }: Props) => {
return
(
<
Skeleton
isLoaded=
{
!
isLoading
}
className=
{
className
}
fontWeight=
{
500
}
whiteSpace=
"pre-wrap"
>
<
IconSvg
name=
"lightning"
boxSize=
{
5
}
color=
"text_secondary"
mr=
{
2
}
verticalAlign=
"text-top"
/>
<
Tooltip
label=
"Transaction summary"
>
<
IconSvg
name=
"lightning"
boxSize=
{
5
}
color=
"text_secondary"
mr=
{
2
}
verticalAlign=
"text-top"
/>
</
Tooltip
>
{
chunks
.
map
((
chunk
,
index
)
=>
{
return
(
<
chakra
.
span
key=
{
chunk
+
index
}
>
...
...
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