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
42149143
Commit
42149143
authored
Feb 27, 2023
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
69fb150d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
51 deletions
+31
-51
README.md
README.md
+0
-12
output-roots.tsx
pages/output-roots.tsx
+2
-2
OutputRootsListItem.tsx
ui/outputRoots/OutputRootsListItem.tsx
+16
-18
OutputRootsTable.tsx
ui/outputRoots/OutputRootsTable.tsx
+1
-1
OutputRootsTableItem.tsx
ui/outputRoots/OutputRootsTableItem.tsx
+11
-17
OutputRoots.tsx
ui/pages/OutputRoots.tsx
+1
-1
No files found.
README.md
View file @
42149143
...
@@ -140,18 +140,6 @@ The app instance could be customized by passing following variables to NodeJS en
...
@@ -140,18 +140,6 @@ The app instance could be customized by passing following variables to NodeJS en
| NEXT_PUBLIC_IS_L2_NETWORK |
`boolean`
*(optional)*
| Set to true for L2 solutions (Optimism Bedrock based) | false |
| NEXT_PUBLIC_IS_L2_NETWORK |
`boolean`
*(optional)*
| Set to true for L2 solutions (Optimism Bedrock based) | false |
| NEXT_PUBLIC_L1_BASE_URL |
`string`
*(optional)*
| Base Blockscout URL for L1 network |
`'http://eth-goerli.blockscout.com'`
|
| NEXT_PUBLIC_L1_BASE_URL |
`string`
*(optional)*
| Base Blockscout URL for L1 network |
`'http://eth-goerli.blockscout.com'`
|
### L2 configuration
| Variable | Type | Description | Default value
| --- | --- | --- | --- |
| NEXT_PUBLIC_IS_L2_NETWORK |
`boolean`
*(optional)*
| Set to true for L2 solutions (Optimism Bedrock based) | false |
| NEXT_PUBLIC_L1_BASE_URL |
`string`
*(optional)*
| Base Blockscout URL for L1 network |
`'http://eth-goerli.blockscout.com'`
|
### L2 configuration
| Variable | Type | Description | Default value
| --- | --- | --- | --- |
| NEXT_PUBLIC_IS_L2_NETWORK |
`boolean`
*(optional)*
| Set to true for L2 solutions (Optimism Bedrock based) | false |
| NEXT_PUBLIC_L1_BASE_URL |
`string`
*(optional)*
| Base Blockscout URL for L1 network |
`'http://eth-goerli.blockscout.com'`
|
### Marketplace app configuration properties
### Marketplace app configuration properties
| Property | Type | Description | Example value
| Property | Type | Description | Example value
...
...
pages/output-roots.tsx
View file @
42149143
...
@@ -5,7 +5,7 @@ import React from 'react';
...
@@ -5,7 +5,7 @@ import React from 'react';
import
getNetworkTitle
from
'
lib/networks/getNetworkTitle
'
;
import
getNetworkTitle
from
'
lib/networks/getNetworkTitle
'
;
import
OutputRoots
from
'
ui/pages/OutputRoots
'
;
import
OutputRoots
from
'
ui/pages/OutputRoots
'
;
const
Token
sPage
:
NextPage
=
()
=>
{
const
OutputRoot
sPage
:
NextPage
=
()
=>
{
const
title
=
getNetworkTitle
();
const
title
=
getNetworkTitle
();
return
(
return
(
<>
<>
...
@@ -17,6 +17,6 @@ const TokensPage: NextPage = () => {
...
@@ -17,6 +17,6 @@ const TokensPage: NextPage = () => {
);
);
};
};
export
default
Token
sPage
;
export
default
OutputRoot
sPage
;
export
{
getServerSideProps
}
from
'
lib/next/getServerSidePropsL2
'
;
export
{
getServerSideProps
}
from
'
lib/next/getServerSidePropsL2
'
;
ui/outputRoots/OutputRootsListItem.tsx
View file @
42149143
/* eslint-disable @typescript-eslint/naming-convention */
import
{
Box
,
Flex
,
Text
,
HStack
,
Icon
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Flex
,
Text
,
HStack
,
Icon
}
from
'
@chakra-ui/react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -14,39 +13,38 @@ import LinkExternal from 'ui/shared/LinkExternal';
...
@@ -14,39 +13,38 @@ import LinkExternal from 'ui/shared/LinkExternal';
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile
'
;
type
Props
=
OutputRootsItem
;
type
Props
=
{
item
:
OutputRootsItem
}
;
const
OutputRootsListItem
=
({
const
OutputRootsListItem
=
({
item
}:
Props
)
=>
{
l2_output_index
,
const
timeAgo
=
useTimeAgoIncrement
(
item
.
l1_timestamp
,
false
);
l1_timestamp
,
l2_block_number
,
l1_tx_hash
,
output_root
,
}:
Props
)
=>
{
const
timeAgo
=
useTimeAgoIncrement
(
l1_timestamp
,
false
);
return
(
return
(
<
ListItemMobile
rowGap=
{
3
}
>
<
ListItemMobile
rowGap=
{
3
}
>
<
Flex
alignItems=
"center"
justifyContent=
"space-between"
w=
"100%"
>
<
Flex
alignItems=
"center"
justifyContent=
"space-between"
w=
"100%"
>
#
{
l2_output_index
}
#
{
item
.
l2_output_index
}
{
l1_timestamp
&&
<
Text
variant=
"secondary"
fontWeight=
"400"
fontSize=
"sm"
>
{
timeAgo
}
</
Text
>
}
{
item
.
l1_timestamp
&&
<
Text
variant=
"secondary"
fontWeight=
"400"
fontSize=
"sm"
>
{
timeAgo
}
</
Text
>
}
</
Flex
>
</
Flex
>
<
HStack
spacing=
{
3
}
>
<
HStack
spacing=
{
3
}
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
L2 block
</
Text
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
>
L2 block
</
Text
>
<
LinkInternal
display=
"flex"
alignItems=
"center"
href=
{
route
({
pathname
:
'
/block/[height]
'
,
query
:
{
height
:
l2_block_number
.
toString
()
}
})
}
>
<
LinkInternal
{
l2_block_number
}
display=
"flex"
width=
"fit-content"
alignItems=
"center"
href=
{
route
({
pathname
:
'
/block/[height]
'
,
query
:
{
height
:
item
.
l2_block_number
.
toString
()
}
})
}
>
{
item
.
l2_block_number
}
</
LinkInternal
>
</
LinkInternal
>
</
HStack
>
</
HStack
>
<
HStack
spacing=
{
3
}
width=
"100%"
>
<
HStack
spacing=
{
3
}
width=
"100%"
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
whiteSpace=
"nowrap"
>
Output root
</
Text
>
<
Text
fontSize=
"sm"
fontWeight=
{
500
}
whiteSpace=
"nowrap"
>
Output root
</
Text
>
<
Flex
overflow=
"hidden"
whiteSpace=
"nowrap"
alignItems=
"center"
w=
"100%"
>
<
Flex
overflow=
"hidden"
whiteSpace=
"nowrap"
alignItems=
"center"
w=
"100%"
>
<
Text
variant=
"secondary"
w=
"calc(100% - 36px)"
><
HashStringShortenDynamic
hash=
{
output_root
}
/></
Text
>
<
Text
variant=
"secondary"
w=
"calc(100% - 36px)"
><
HashStringShortenDynamic
hash=
{
item
.
output_root
}
/></
Text
>
<
CopyToClipboard
text=
{
output_root
}
ml=
{
2
}
/>
<
CopyToClipboard
text=
{
item
.
output_root
}
ml=
{
2
}
/>
</
Flex
>
</
Flex
>
</
HStack
>
</
HStack
>
<
LinkExternal
w=
"100%"
href=
{
appConfig
.
L2
.
L1BaseUrl
+
route
({
pathname
:
'
/tx/[hash]
'
,
query
:
{
hash
:
l1_tx_hash
}
})
}
>
<
LinkExternal
w=
"100%"
href=
{
appConfig
.
L2
.
L1BaseUrl
+
route
({
pathname
:
'
/tx/[hash]
'
,
query
:
{
hash
:
item
.
l1_tx_hash
}
})
}
>
<
Icon
as=
{
txIcon
}
boxSize=
{
6
}
mr=
{
1
}
/>
<
Icon
as=
{
txIcon
}
boxSize=
{
6
}
mr=
{
1
}
/>
<
Box
w=
"calc(100% - 36px)"
overflow=
"hidden"
whiteSpace=
"nowrap"
><
HashStringShortenDynamic
hash=
{
l1_tx_hash
}
/></
Box
>
<
Box
w=
"calc(100% - 36px)"
overflow=
"hidden"
whiteSpace=
"nowrap"
><
HashStringShortenDynamic
hash=
{
item
.
l1_tx_hash
}
/></
Box
>
</
LinkExternal
>
</
LinkExternal
>
</
ListItemMobile
>
</
ListItemMobile
>
);
);
...
...
ui/outputRoots/OutputRootsTable.tsx
View file @
42149143
...
@@ -26,7 +26,7 @@ const OutputRootsTable = ({ items, top }: Props) => {
...
@@ -26,7 +26,7 @@ const OutputRootsTable = ({ items, top }: Props) => {
</
Thead
>
</
Thead
>
<
Tbody
>
<
Tbody
>
{
items
.
map
((
item
)
=>
(
{
items
.
map
((
item
)
=>
(
<
OutputRootsTableItem
key=
{
item
.
l2_output_index
}
{
...
item
}
/>
<
OutputRootsTableItem
key=
{
item
.
l2_output_index
}
item=
{
item
}
/>
))
}
))
}
</
Tbody
>
</
Tbody
>
</
Table
>
</
Table
>
...
...
ui/outputRoots/OutputRootsTableItem.tsx
View file @
42149143
/* eslint-disable @typescript-eslint/naming-convention */
import
{
Box
,
Flex
,
Td
,
Tr
,
Text
,
Icon
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Flex
,
Td
,
Tr
,
Text
,
Icon
}
from
'
@chakra-ui/react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -14,21 +13,15 @@ import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic';
...
@@ -14,21 +13,15 @@ import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic';
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
type
Props
=
OutputRootsItem
;
type
Props
=
{
item
:
OutputRootsItem
}
;
const
OutputRootsTableItem
=
({
const
OutputRootsTableItem
=
({
item
}:
Props
)
=>
{
l2_output_index
,
const
timeAgo
=
useTimeAgoIncrement
(
item
.
l1_timestamp
,
false
);
l1_timestamp
,
l2_block_number
,
l1_tx_hash
,
output_root
,
}:
Props
)
=>
{
const
timeAgo
=
useTimeAgoIncrement
(
l1_timestamp
,
false
);
return
(
return
(
<
Tr
>
<
Tr
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
Text
>
{
l2_output_index
}
</
Text
>
<
Text
>
{
item
.
l2_output_index
}
</
Text
>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
Text
variant=
"secondary"
>
{
timeAgo
}
</
Text
>
<
Text
variant=
"secondary"
>
{
timeAgo
}
</
Text
>
...
@@ -37,25 +30,26 @@ const OutputRootsTableItem = ({
...
@@ -37,25 +30,26 @@ const OutputRootsTableItem = ({
<
LinkInternal
<
LinkInternal
fontWeight=
{
600
}
fontWeight=
{
600
}
display=
"flex"
display=
"flex"
width=
"fit-content"
alignItems=
"center"
alignItems=
"center"
href=
{
route
({
pathname
:
'
/block/[height]
'
,
query
:
{
height
:
l2_block_number
.
toString
()
}
})
}
href=
{
route
({
pathname
:
'
/block/[height]
'
,
query
:
{
height
:
item
.
l2_block_number
.
toString
()
}
})
}
>
>
<
Icon
as=
{
txBatchIcon
}
boxSize=
{
6
}
mr=
{
1
}
/>
<
Icon
as=
{
txBatchIcon
}
boxSize=
{
6
}
mr=
{
1
}
/>
{
l2_block_number
}
{
item
.
l2_block_number
}
</
LinkInternal
>
</
LinkInternal
>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
pr=
{
12
}
>
<
Td
verticalAlign=
"middle"
pr=
{
12
}
>
<
Flex
>
<
Flex
>
<
LinkExternal
w=
"100%"
href=
{
appConfig
.
L2
.
L1BaseUrl
+
route
({
pathname
:
'
/tx/[hash]
'
,
query
:
{
hash
:
l1_tx_hash
}
})
}
>
<
LinkExternal
w=
"100%"
href=
{
appConfig
.
L2
.
L1BaseUrl
+
route
({
pathname
:
'
/tx/[hash]
'
,
query
:
{
hash
:
item
.
l1_tx_hash
}
})
}
>
<
Icon
as=
{
txIcon
}
boxSize=
{
6
}
mr=
{
1
}
/>
<
Icon
as=
{
txIcon
}
boxSize=
{
6
}
mr=
{
1
}
/>
<
Box
w=
"calc(100% - 36px)"
overflow=
"hidden"
whiteSpace=
"nowrap"
><
HashStringShortenDynamic
hash=
{
l1_tx_hash
}
/></
Box
>
<
Box
w=
"calc(100% - 36px)"
overflow=
"hidden"
whiteSpace=
"nowrap"
><
HashStringShortenDynamic
hash=
{
item
.
l1_tx_hash
}
/></
Box
>
</
LinkExternal
>
</
LinkExternal
>
</
Flex
>
</
Flex
>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
Flex
overflow=
"hidden"
whiteSpace=
"nowrap"
w=
"100%"
alignItems=
"center"
>
<
Flex
overflow=
"hidden"
whiteSpace=
"nowrap"
w=
"100%"
alignItems=
"center"
>
<
Box
w=
"calc(100% - 36px)"
><
HashStringShortenDynamic
hash=
{
output_root
}
/></
Box
>
<
Box
w=
"calc(100% - 36px)"
><
HashStringShortenDynamic
hash=
{
item
.
output_root
}
/></
Box
>
<
CopyToClipboard
text=
{
output_root
}
ml=
{
2
}
/>
<
CopyToClipboard
text=
{
item
.
output_root
}
ml=
{
2
}
/>
</
Flex
>
</
Flex
>
</
Td
>
</
Td
>
</
Tr
>
</
Tr
>
...
...
ui/pages/OutputRoots.tsx
View file @
42149143
...
@@ -55,7 +55,7 @@ const OutputRoots = () => {
...
@@ -55,7 +55,7 @@ const OutputRoots = () => {
</
Flex
>
</
Flex
>
</
ActionBar
>
</
ActionBar
>
)
}
)
}
<
Show
below=
"lg"
ssr=
{
false
}
>
{
data
.
items
.
map
((
item
=>
<
OutputRootsListItem
key=
{
item
.
l2_output_index
}
{
...
item
}
/>))
}
</
Show
>
<
Show
below=
"lg"
ssr=
{
false
}
>
{
data
.
items
.
map
((
item
=>
<
OutputRootsListItem
key=
{
item
.
l2_output_index
}
item=
{
item
}
/>))
}
</
Show
>
<
Hide
below=
"lg"
ssr=
{
false
}
><
OutputRootsTable
items=
{
data
.
items
}
top=
{
isPaginationVisible
?
80
:
0
}
/></
Hide
>
<
Hide
below=
"lg"
ssr=
{
false
}
><
OutputRootsTable
items=
{
data
.
items
}
top=
{
isPaginationVisible
?
80
:
0
}
/></
Hide
>
</>
</>
);
);
...
...
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