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
97ca6234
Commit
97ca6234
authored
Sep 27, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
route and page placeholder
parent
150c98f4
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
135 additions
and
5 deletions
+135
-5
routes.ts
lib/link/routes.ts
+4
-1
BlockNextPage.tsx
lib/next/block/BlockNextPage.tsx
+30
-0
getSeo.ts
lib/next/block/getSeo.ts
+12
-0
getStaticPaths.ts
lib/next/block/getStaticPaths.ts
+5
-0
types.ts
lib/next/block/types.ts
+5
-0
TransactionNextPage.tsx
lib/next/tx/TransactionNextPage.tsx
+5
-2
index.tsx
pages/[network_type]/[network_sub_type]/block/[id]/index.tsx
+21
-0
transactions.tsx
...work_type]/[network_sub_type]/block/[id]/transactions.tsx
+21
-0
Block.tsx
ui/pages/Block.tsx
+30
-0
TxsListItem.tsx
ui/txs/TxsListItem.tsx
+1
-1
TxsTableItem.tsx
ui/txs/TxsTableItem.tsx
+1
-1
No files found.
lib/link/routes.ts
View file @
97ca6234
...
@@ -74,9 +74,12 @@ export const ROUTES = {
...
@@ -74,9 +74,12 @@ export const ROUTES = {
pattern
:
`
${
BASE_PATH
}
/blocks`
,
pattern
:
`
${
BASE_PATH
}
/blocks`
,
crossNetworkNavigation
:
true
,
crossNetworkNavigation
:
true
,
},
},
block
:
{
block
_index
:
{
pattern
:
`
${
BASE_PATH
}
/block/[id]`
,
pattern
:
`
${
BASE_PATH
}
/block/[id]`
,
},
},
block_txs
:
{
pattern
:
`
${
BASE_PATH
}
/block/[id]/transactions`
,
},
// TOKENS
// TOKENS
tokens
:
{
tokens
:
{
...
...
lib/next/block/BlockNextPage.tsx
0 → 100644
View file @
97ca6234
import
type
{
NextPage
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
type
{
PageParams
}
from
'
./types
'
;
import
Block
from
'
ui/pages/Block
'
;
import
type
{
Props
as
BlockProps
}
from
'
ui/pages/Block
'
;
import
getSeo
from
'
./getSeo
'
;
type
Props
=
{
pageParams
:
PageParams
;
tab
:
BlockProps
[
'
tab
'
];
}
const
BlockNextPage
:
NextPage
<
Props
>
=
({
pageParams
,
tab
}:
Props
)
=>
{
const
{
title
,
description
}
=
getSeo
(
pageParams
);
return
(
<>
<
Head
>
<
title
>
{
title
}
</
title
>
<
meta
name=
"description"
content=
{
description
}
/>
</
Head
>
<
Block
tab=
{
tab
}
/>
</>
);
};
export
default
BlockNextPage
;
lib/next/block/getSeo.ts
0 → 100644
View file @
97ca6234
import
type
{
PageParams
}
from
'
./types
'
;
import
getNetworkTitle
from
'
lib/networks/getNetworkTitle
'
;
export
default
function
getSeo
(
params
?:
PageParams
)
{
const
networkTitle
=
getNetworkTitle
(
params
||
{});
return
{
title
:
params
?
`Block
${
params
.
id
}
-
${
networkTitle
}
`
:
''
,
description
:
params
?
`View the transactions, token transfers, and uncles for block number
${
params
.
id
}
`
:
''
,
};
}
lib/next/block/getStaticPaths.ts
0 → 100644
View file @
97ca6234
import
type
{
GetStaticPaths
}
from
'
next
'
;
export
const
getStaticPaths
:
GetStaticPaths
=
async
()
=>
{
return
{
paths
:
[],
fallback
:
true
};
};
lib/next/block/types.ts
0 → 100644
View file @
97ca6234
export
type
PageParams
=
{
network_type
:
string
;
network_sub_type
:
string
;
id
:
string
;
}
lib/next/tx/TransactionNextPage.tsx
View file @
97ca6234
...
@@ -15,10 +15,13 @@ type Props = {
...
@@ -15,10 +15,13 @@ type Props = {
}
}
const
TransactionNextPage
:
NextPage
<
Props
>
=
({
pageParams
,
tab
}:
Props
)
=>
{
const
TransactionNextPage
:
NextPage
<
Props
>
=
({
pageParams
,
tab
}:
Props
)
=>
{
const
{
title
}
=
getSeo
(
pageParams
);
const
{
title
,
description
}
=
getSeo
(
pageParams
);
return
(
return
(
<>
<>
<
Head
><
title
>
{
title
}
</
title
></
Head
>
<
Head
>
<
title
>
{
title
}
</
title
>
<
meta
name=
"description"
content=
{
description
}
/>
</
Head
>
<
Transaction
tab=
{
tab
}
/>
<
Transaction
tab=
{
tab
}
/>
</>
</>
);
);
...
...
pages/[network_type]/[network_sub_type]/block/[id]/index.tsx
0 → 100644
View file @
97ca6234
import
type
{
NextPage
}
from
'
next
'
;
import
React
from
'
react
'
;
import
type
{
PageParams
}
from
'
lib/next/tx/types
'
;
import
BlockNextPage
from
'
lib/next/block/BlockNextPage
'
;
type
Props
=
{
pageParams
:
PageParams
;
}
const
BlockPage
:
NextPage
<
Props
>
=
({
pageParams
}:
Props
)
=>
{
return
(
<
BlockNextPage
tab=
"block_index"
pageParams=
{
pageParams
}
/>
);
};
export
default
BlockPage
;
export
{
getStaticPaths
}
from
'
lib/next/block/getStaticPaths
'
;
export
{
getStaticProps
}
from
'
lib/next/getStaticProps
'
;
pages/[network_type]/[network_sub_type]/block/[id]/transactions.tsx
0 → 100644
View file @
97ca6234
import
type
{
NextPage
}
from
'
next
'
;
import
React
from
'
react
'
;
import
type
{
PageParams
}
from
'
lib/next/tx/types
'
;
import
BlockNextPage
from
'
lib/next/block/BlockNextPage
'
;
type
Props
=
{
pageParams
:
PageParams
;
}
const
BlockPage
:
NextPage
<
Props
>
=
({
pageParams
}:
Props
)
=>
{
return
(
<
BlockNextPage
tab=
"block_txs"
pageParams=
{
pageParams
}
/>
);
};
export
default
BlockPage
;
export
{
getStaticPaths
}
from
'
lib/next/block/getStaticPaths
'
;
export
{
getStaticProps
}
from
'
lib/next/getStaticProps
'
;
ui/pages/Block.tsx
0 → 100644
View file @
97ca6234
import
React
from
'
react
'
;
import
type
{
RoutedTab
}
from
'
ui/shared/RoutedTabs/types
'
;
import
Page
from
'
ui/shared/Page
'
;
import
PageHeader
from
'
ui/shared/PageHeader
'
;
import
RoutedTabs
from
'
ui/shared/RoutedTabs/RoutedTabs
'
;
const
TABS
:
Array
<
RoutedTab
>
=
[
{
routeName
:
'
block_index
'
,
title
:
'
Details
'
,
component
:
<
div
>
Details
</
div
>
},
{
routeName
:
'
block_txs
'
,
title
:
'
Transactions
'
,
component
:
<
div
>
Transactions
</
div
>
},
];
export
interface
Props
{
tab
:
RoutedTab
[
'
routeName
'
];
}
const
BlockPageContent
=
({
tab
}:
Props
)
=>
{
return
(
<
Page
>
<
PageHeader
text=
"Block"
/>
<
RoutedTabs
tabs=
{
TABS
}
defaultActiveTab=
{
tab
}
/>
</
Page
>
);
};
export
default
BlockPageContent
;
ui/txs/TxsListItem.tsx
View file @
97ca6234
...
@@ -77,7 +77,7 @@ const TxsListItem = ({ tx }: {tx: ArrayElement<typeof txs>}) => {
...
@@ -77,7 +77,7 @@ const TxsListItem = ({ tx }: {tx: ArrayElement<typeof txs>}) => {
</
Flex
>
</
Flex
>
<
Box
mt=
{
2
}
>
<
Box
mt=
{
2
}
>
<
Text
as=
"span"
>
Block
</
Text
>
<
Text
as=
"span"
>
Block
</
Text
>
<
Link
href=
{
link
(
'
block
'
,
{
id
:
tx
.
block_num
.
toString
()
})
}
>
{
tx
.
block_num
}
</
Link
>
<
Link
href=
{
link
(
'
block
_index
'
,
{
id
:
tx
.
block_num
.
toString
()
})
}
>
{
tx
.
block_num
}
</
Link
>
</
Box
>
</
Box
>
<
Flex
alignItems=
"center"
height=
{
6
}
mt=
{
6
}
>
<
Flex
alignItems=
"center"
height=
{
6
}
mt=
{
6
}
>
<
Address
width=
"calc((100%-40px)/2)"
>
<
Address
width=
"calc((100%-40px)/2)"
>
...
...
ui/txs/TxsTableItem.tsx
View file @
97ca6234
...
@@ -106,7 +106,7 @@ const TxsTableItem = ({ tx }: {tx: ArrayElement<typeof txs>}) => {
...
@@ -106,7 +106,7 @@ const TxsTableItem = ({ tx }: {tx: ArrayElement<typeof txs>}) => {
</
TruncatedTextTooltip
>
</
TruncatedTextTooltip
>
</
Td
>
</
Td
>
<
Td
>
<
Td
>
<
Link
href=
{
link
(
'
block
'
,
{
id
:
tx
.
block_num
.
toString
()
})
}
>
{
tx
.
block_num
}
</
Link
>
<
Link
href=
{
link
(
'
block
_index
'
,
{
id
:
tx
.
block_num
.
toString
()
})
}
>
{
tx
.
block_num
}
</
Link
>
</
Td
>
</
Td
>
{
isLargeScreen
?
(
{
isLargeScreen
?
(
<>
<>
...
...
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