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
86d8e34f
Commit
86d8e34f
authored
Sep 28, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
page setup
parent
34ba27e1
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
149 additions
and
0 deletions
+149
-0
routes.ts
lib/link/routes.ts
+8
-0
BlocksNextPage.tsx
lib/next/blocks/BlocksNextPage.tsx
+29
-0
getSeo.ts
lib/next/blocks/getSeo.ts
+11
-0
types.ts
lib/next/blocks/types.ts
+4
-0
blocks.tsx
pages/[network_type]/[network_sub_type]/blocks.tsx
+21
-0
reorgs.tsx
pages/[network_type]/[network_sub_type]/reorgs.tsx
+21
-0
uncles.tsx
pages/[network_type]/[network_sub_type]/uncles.tsx
+21
-0
Blocks.tsx
ui/pages/Blocks.tsx
+34
-0
No files found.
lib/link/routes.ts
View file @
86d8e34f
...
@@ -74,6 +74,14 @@ export const ROUTES = {
...
@@ -74,6 +74,14 @@ export const ROUTES = {
pattern
:
`
${
BASE_PATH
}
/blocks`
,
pattern
:
`
${
BASE_PATH
}
/blocks`
,
crossNetworkNavigation
:
true
,
crossNetworkNavigation
:
true
,
},
},
uncles
:
{
pattern
:
`
${
BASE_PATH
}
/uncles`
,
crossNetworkNavigation
:
true
,
},
reorgs
:
{
pattern
:
`
${
BASE_PATH
}
/reorgs`
,
crossNetworkNavigation
:
true
,
},
block_index
:
{
block_index
:
{
pattern
:
`
${
BASE_PATH
}
/block/[id]`
,
pattern
:
`
${
BASE_PATH
}
/block/[id]`
,
},
},
...
...
lib/next/blocks/BlocksNextPage.tsx
0 → 100644
View file @
86d8e34f
import
type
{
NextPage
}
from
'
next
'
;
import
Head
from
'
next/head
'
;
import
React
from
'
react
'
;
import
type
{
PageParams
}
from
'
./types
'
;
import
Blocks
from
'
ui/pages/Blocks
'
;
import
type
{
Props
as
BlocksProps
}
from
'
ui/pages/Blocks
'
;
import
getSeo
from
'
./getSeo
'
;
type
Props
=
{
pageParams
:
PageParams
;
tab
:
BlocksProps
[
'
tab
'
];
}
const
BlocksNextPage
:
NextPage
<
Props
>
=
({
pageParams
,
tab
}:
Props
)
=>
{
const
{
title
}
=
getSeo
(
pageParams
);
return
(
<>
<
Head
>
<
title
>
{
title
}
</
title
>
</
Head
>
<
Blocks
tab=
{
tab
}
/>
</>
);
};
export
default
BlocksNextPage
;
lib/next/blocks/getSeo.ts
0 → 100644
View file @
86d8e34f
import
type
{
PageParams
}
from
'
./types
'
;
import
getNetworkTitle
from
'
lib/networks/getNetworkTitle
'
;
export
default
function
getSeo
(
params
?:
PageParams
)
{
const
networkTitle
=
getNetworkTitle
(
params
||
{});
return
{
title
:
params
?
`
${
networkTitle
}
- BlockScout`
:
''
,
};
}
lib/next/blocks/types.ts
0 → 100644
View file @
86d8e34f
export
type
PageParams
=
{
network_type
:
string
;
network_sub_type
:
string
;
}
pages/[network_type]/[network_sub_type]/blocks.tsx
0 → 100644
View file @
86d8e34f
import
type
{
NextPage
}
from
'
next
'
;
import
React
from
'
react
'
;
import
type
{
PageParams
}
from
'
lib/next/tx/types
'
;
import
BlocksNextPage
from
'
lib/next/blocks/BlocksNextPage
'
;
type
Props
=
{
pageParams
:
PageParams
;
}
const
BlockPage
:
NextPage
<
Props
>
=
({
pageParams
}:
Props
)
=>
{
return
(
<
BlocksNextPage
tab=
"blocks"
pageParams=
{
pageParams
}
/>
);
};
export
default
BlockPage
;
export
{
getStaticPaths
}
from
'
lib/next/block/getStaticPaths
'
;
export
{
getStaticProps
}
from
'
lib/next/getStaticProps
'
;
pages/[network_type]/[network_sub_type]/reorgs.tsx
0 → 100644
View file @
86d8e34f
import
type
{
NextPage
}
from
'
next
'
;
import
React
from
'
react
'
;
import
type
{
PageParams
}
from
'
lib/next/tx/types
'
;
import
BlocksNextPage
from
'
lib/next/blocks/BlocksNextPage
'
;
type
Props
=
{
pageParams
:
PageParams
;
}
const
BlockPage
:
NextPage
<
Props
>
=
({
pageParams
}:
Props
)
=>
{
return
(
<
BlocksNextPage
tab=
"reorgs"
pageParams=
{
pageParams
}
/>
);
};
export
default
BlockPage
;
export
{
getStaticPaths
}
from
'
lib/next/block/getStaticPaths
'
;
export
{
getStaticProps
}
from
'
lib/next/getStaticProps
'
;
pages/[network_type]/[network_sub_type]/uncles.tsx
0 → 100644
View file @
86d8e34f
import
type
{
NextPage
}
from
'
next
'
;
import
React
from
'
react
'
;
import
type
{
PageParams
}
from
'
lib/next/tx/types
'
;
import
BlocksNextPage
from
'
lib/next/blocks/BlocksNextPage
'
;
type
Props
=
{
pageParams
:
PageParams
;
}
const
BlockPage
:
NextPage
<
Props
>
=
({
pageParams
}:
Props
)
=>
{
return
(
<
BlocksNextPage
tab=
"uncles"
pageParams=
{
pageParams
}
/>
);
};
export
default
BlockPage
;
export
{
getStaticPaths
}
from
'
lib/next/block/getStaticPaths
'
;
export
{
getStaticProps
}
from
'
lib/next/getStaticProps
'
;
ui/pages/Blocks.tsx
0 → 100644
View file @
86d8e34f
import
{
useRouter
}
from
'
next/router
'
;
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
:
'
blocks
'
,
title
:
'
All
'
,
component
:
<
div
>
All
</
div
>
},
{
routeName
:
'
reorgs
'
,
title
:
'
Forked
'
,
component
:
<
div
>
Forked
</
div
>
},
{
routeName
:
'
uncles
'
,
title
:
'
Uncles
'
,
component
:
<
div
>
Uncles
</
div
>
},
];
export
interface
Props
{
tab
:
RoutedTab
[
'
routeName
'
];
}
const
BlocksPageContent
=
({
tab
}:
Props
)
=>
{
const
router
=
useRouter
();
return
(
<
Page
>
<
PageHeader
text=
{
`Block #${ router.query.id || '' }`
}
/>
<
RoutedTabs
tabs=
{
TABS
}
defaultActiveTab=
{
tab
}
/>
</
Page
>
);
};
export
default
BlocksPageContent
;
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