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
1030c2bd
Commit
1030c2bd
authored
Oct 20, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go back link
parent
ae531917
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
8 deletions
+15
-8
Transaction.tsx
ui/pages/Transaction.tsx
+9
-6
AddressLink.tsx
ui/shared/address/AddressLink.tsx
+4
-2
TxsListItem.tsx
ui/txs/TxsListItem.tsx
+1
-0
TxsTableItem.tsx
ui/txs/TxsTableItem.tsx
+1
-0
No files found.
ui/pages/Transaction.tsx
View file @
1030c2bd
...
@@ -8,7 +8,7 @@ import type { RoutedTab } from 'ui/shared/RoutedTabs/types';
...
@@ -8,7 +8,7 @@ import type { RoutedTab } from 'ui/shared/RoutedTabs/types';
import
eastArrowIcon
from
'
icons/arrows/east.svg
'
;
import
eastArrowIcon
from
'
icons/arrows/east.svg
'
;
import
useFetch
from
'
lib/hooks/useFetch
'
;
import
useFetch
from
'
lib/hooks/useFetch
'
;
import
link
from
'
lib/link/link
'
;
import
isBrowser
from
'
lib/isBrowser
'
;
import
networkExplorers
from
'
lib/networks/networkExplorers
'
;
import
networkExplorers
from
'
lib/networks/networkExplorers
'
;
import
ExternalLink
from
'
ui/shared/ExternalLink
'
;
import
ExternalLink
from
'
ui/shared/ExternalLink
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
...
@@ -48,13 +48,16 @@ const TransactionPageContent = () => {
...
@@ -48,13 +48,16 @@ const TransactionPageContent = () => {
return
<
ExternalLink
key=
{
explorer
.
baseUrl
}
title=
{
`Open in ${ explorer.title }`
}
href=
{
url
.
toString
()
}
/>;
return
<
ExternalLink
key=
{
explorer
.
baseUrl
}
title=
{
`Open in ${ explorer.title }`
}
href=
{
url
.
toString
()
}
/>;
});
});
const
hasGoBackLink
=
isBrowser
()
&&
window
.
document
.
referrer
.
includes
(
'
/txs
'
);
return
(
return
(
<
Page
>
<
Page
>
{
/* TODO should be shown only when navigating from txs list */
}
{
hasGoBackLink
&&
(
<
Link
mb=
{
6
}
display=
"inline-flex"
href=
{
link
(
'
txs
'
)
}
>
<
Link
mb=
{
6
}
display=
"inline-flex"
href=
{
window
.
document
.
referrer
}
>
<
Icon
as=
{
eastArrowIcon
}
boxSize=
{
6
}
mr=
{
2
}
transform=
"rotate(180deg)"
/>
<
Icon
as=
{
eastArrowIcon
}
boxSize=
{
6
}
mr=
{
2
}
transform=
"rotate(180deg)"
/>
Transactions
Transactions
</
Link
>
</
Link
>
)
}
<
Flex
alignItems=
"flex-start"
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
>
<
Flex
alignItems=
"flex-start"
flexDir=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
>
<
PageTitle
text=
"Transaction details"
/>
<
PageTitle
text=
"Transaction details"
/>
{
data
?.
tx_tag
&&
<
Tag
my=
{
2
}
ml=
{
3
}
>
{
data
.
tx_tag
}
</
Tag
>
}
{
data
?.
tx_tag
&&
<
Tag
my=
{
2
}
ml=
{
3
}
>
{
data
.
tx_tag
}
</
Tag
>
}
...
...
ui/shared/address/AddressLink.tsx
View file @
1030c2bd
import
{
Link
,
chakra
,
shouldForwardProp
,
Tooltip
,
Box
}
from
'
@chakra-ui/react
'
;
import
{
Link
,
chakra
,
shouldForwardProp
,
Tooltip
,
Box
}
from
'
@chakra-ui/react
'
;
import
type
{
HTMLAttributeAnchorTarget
}
from
'
react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
link
from
'
lib/link/link
'
;
import
link
from
'
lib/link/link
'
;
...
@@ -13,9 +14,10 @@ interface Props {
...
@@ -13,9 +14,10 @@ interface Props {
truncation
?:
'
constant
'
|
'
dynamic
'
|
'
none
'
;
truncation
?:
'
constant
'
|
'
dynamic
'
|
'
none
'
;
fontWeight
?:
string
;
fontWeight
?:
string
;
id
?:
string
;
id
?:
string
;
target
?:
HTMLAttributeAnchorTarget
;
}
}
const
AddressLink
=
({
alias
,
type
,
className
,
truncation
=
'
dynamic
'
,
hash
,
id
,
fontWeight
}:
Props
)
=>
{
const
AddressLink
=
({
alias
,
type
,
className
,
truncation
=
'
dynamic
'
,
hash
,
id
,
fontWeight
,
target
}:
Props
)
=>
{
let
url
;
let
url
;
if
(
type
===
'
transaction
'
)
{
if
(
type
===
'
transaction
'
)
{
url
=
link
(
'
tx
'
,
{
id
:
id
||
hash
});
url
=
link
(
'
tx
'
,
{
id
:
id
||
hash
});
...
@@ -49,7 +51,7 @@ const AddressLink = ({ alias, type, className, truncation = 'dynamic', hash, id,
...
@@ -49,7 +51,7 @@ const AddressLink = ({ alias, type, className, truncation = 'dynamic', hash, id,
<
Link
<
Link
className=
{
className
}
className=
{
className
}
href=
{
url
}
href=
{
url
}
target=
"_blank"
target=
{
target
||
'
_blank
'
}
overflow=
"hidden"
overflow=
"hidden"
whiteSpace=
"nowrap"
whiteSpace=
"nowrap"
>
>
...
...
ui/txs/TxsListItem.tsx
View file @
1030c2bd
...
@@ -60,6 +60,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
...
@@ -60,6 +60,7 @@ const TxsListItem = ({ tx }: {tx: Transaction}) => {
type=
"transaction"
type=
"transaction"
fontWeight=
"700"
fontWeight=
"700"
truncation=
"constant"
truncation=
"constant"
target=
"_self"
/>
/>
</
Address
>
</
Address
>
</
Flex
>
</
Flex
>
...
...
ui/txs/TxsTableItem.tsx
View file @
1030c2bd
...
@@ -89,6 +89,7 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
...
@@ -89,6 +89,7 @@ const TxsTableItem = ({ tx }: {tx: Transaction}) => {
hash=
{
tx
.
hash
}
hash=
{
tx
.
hash
}
type=
"transaction"
type=
"transaction"
fontWeight=
"700"
fontWeight=
"700"
target=
"_self"
/>
/>
</
Address
>
</
Address
>
<
Text
color=
"gray.500"
fontWeight=
"400"
>
{
dayjs
(
tx
.
timestamp
).
fromNow
()
}
</
Text
>
<
Text
color=
"gray.500"
fontWeight=
"400"
>
{
dayjs
(
tx
.
timestamp
).
fromNow
()
}
</
Text
>
...
...
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