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
22b24070
Commit
22b24070
authored
May 15, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skeleton for block details
parent
52a6dbdc
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
138 additions
and
107 deletions
+138
-107
[height].tsx
pages/block/[height].tsx
+3
-1
BlockDetails.tsx
ui/block/BlockDetails.tsx
+116
-61
BlockDetailsSkeleton.tsx
ui/block/details/BlockDetailsSkeleton.tsx
+0
-40
Block.tsx
ui/pages/Block.tsx
+7
-3
PrevNext.tsx
ui/shared/PrevNext.tsx
+12
-2
No files found.
pages/block/[height].tsx
View file @
22b24070
import
type
{
NextPage
}
from
'
next
'
;
import
dynamic
from
'
next/dynamic
'
;
import
Head
from
'
next/head
'
;
import
type
{
RoutedQuery
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
getSeo
from
'
lib/next/block/getSeo
'
;
import
Block
from
'
ui/pages/Block
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
const
Block
=
dynamic
(()
=>
import
(
'
ui/pages/Block
'
),
{
ssr
:
false
});
const
BlockPage
:
NextPage
<
RoutedQuery
<
'
/block/[height]
'
>>
=
({
height
}:
RoutedQuery
<
'
/block/[height]
'
>
)
=>
{
const
{
title
,
description
}
=
getSeo
({
height
});
return
(
...
...
ui/block/BlockDetails.tsx
View file @
22b24070
This diff is collapsed.
Click to expand it.
ui/block/details/BlockDetailsSkeleton.tsx
deleted
100644 → 0
View file @
52a6dbdc
import
{
Grid
,
GridItem
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
DetailsSkeletonRow
from
'
ui/shared/skeletons/DetailsSkeletonRow
'
;
const
BlockDetailsSkeleton
=
()
=>
{
const
sectionGap
=
(
<
GridItem
colSpan=
{
{
base
:
undefined
,
lg
:
2
}
}
mt=
{
{
base
:
2
,
lg
:
3
}
}
mb=
{
{
base
:
0
,
lg
:
3
}
}
borderBottom=
"1px solid"
borderColor=
"divider"
/>
);
return
(
<
Grid
columnGap=
{
8
}
rowGap=
{
{
base
:
5
,
lg
:
7
}
}
templateColumns=
{
{
base
:
'
1fr
'
,
lg
:
'
210px 1fr
'
}
}
maxW=
"1000px"
>
<
DetailsSkeletonRow
w=
"25%"
/>
<
DetailsSkeletonRow
w=
"25%"
/>
<
DetailsSkeletonRow
w=
"65%"
/>
<
DetailsSkeletonRow
w=
"25%"
/>
<
DetailsSkeletonRow
/>
<
DetailsSkeletonRow
/>
{
sectionGap
}
<
DetailsSkeletonRow
w=
"50%"
/>
<
DetailsSkeletonRow
w=
"25%"
/>
<
DetailsSkeletonRow
w=
"50%"
/>
<
DetailsSkeletonRow
w=
"50%"
/>
<
DetailsSkeletonRow
w=
"50%"
/>
{
sectionGap
}
<
GridItem
colSpan=
{
{
base
:
undefined
,
lg
:
2
}
}
>
<
Skeleton
h=
{
5
}
borderRadius=
"full"
w=
"100px"
/>
</
GridItem
>
</
Grid
>
);
};
export
default
BlockDetailsSkeleton
;
ui/pages/Block.tsx
View file @
22b24070
...
...
@@ -10,6 +10,7 @@ import { useAppContext } from 'lib/appContext';
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useQueryWithPages
from
'
lib/hooks/useQueryWithPages
'
;
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
{
BLOCK
}
from
'
stubs/block
'
;
import
BlockDetails
from
'
ui/block/BlockDetails
'
;
import
BlockWithdrawals
from
'
ui/block/BlockWithdrawals
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
...
...
@@ -35,14 +36,17 @@ const BlockPageContent = () => {
const
blockQuery
=
useApiQuery
(
'
block
'
,
{
pathParams
:
{
height
},
queryOptions
:
{
enabled
:
Boolean
(
height
)
},
queryOptions
:
{
enabled
:
Boolean
(
height
),
placeholderData
:
BLOCK
,
},
});
const
blockTxsQuery
=
useQueryWithPages
({
resourceName
:
'
block_txs
'
,
pathParams
:
{
height
},
options
:
{
enabled
:
Boolean
(
blockQuery
.
data
?.
height
&&
tab
===
'
txs
'
),
enabled
:
Boolean
(
!
blockQuery
.
isPlaceholderData
&&
blockQuery
.
data
?.
height
&&
tab
===
'
txs
'
),
},
});
...
...
@@ -50,7 +54,7 @@ const BlockPageContent = () => {
resourceName
:
'
block_withdrawals
'
,
pathParams
:
{
height
},
options
:
{
enabled
:
Boolean
(
blockQuery
.
data
?.
height
&&
appConfig
.
beaconChain
.
hasBeaconChain
&&
tab
===
'
withdrawals
'
),
enabled
:
Boolean
(
!
blockQuery
.
isPlaceholderData
&&
blockQuery
.
data
?.
height
&&
appConfig
.
beaconChain
.
hasBeaconChain
&&
tab
===
'
withdrawals
'
),
},
});
...
...
ui/shared/PrevNext.tsx
View file @
22b24070
import
{
Box
,
Icon
,
IconButton
,
chakra
,
Tooltip
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Icon
,
IconButton
,
chakra
,
Tooltip
,
Flex
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
eastArrow
from
'
icons/arrows/east-mini.svg
'
;
...
...
@@ -10,9 +10,10 @@ interface Props {
nextLabel
?:
string
;
isPrevDisabled
?:
boolean
;
isNextDisabled
?:
boolean
;
isLoading
?:
boolean
;
}
const
PrevNext
=
({
className
,
onClick
,
prevLabel
,
nextLabel
,
isPrevDisabled
,
isNextDisabled
}:
Props
)
=>
{
const
PrevNext
=
({
className
,
onClick
,
prevLabel
,
nextLabel
,
isPrevDisabled
,
isNextDisabled
,
isLoading
}:
Props
)
=>
{
const
handelPrevClick
=
React
.
useCallback
(()
=>
{
onClick
(
'
prev
'
);
},
[
onClick
]);
...
...
@@ -21,6 +22,15 @@ const PrevNext = ({ className, onClick, prevLabel, nextLabel, isPrevDisabled, is
onClick
(
'
next
'
);
},
[
onClick
]);
if
(
isLoading
)
{
return
(
<
Flex
columnGap=
"10px"
className=
{
className
}
>
<
Skeleton
boxSize=
{
6
}
borderRadius=
"sm"
/>
<
Skeleton
boxSize=
{
6
}
borderRadius=
"sm"
/>
</
Flex
>
);
}
return
(
<
Box
className=
{
className
}
>
<
Tooltip
label=
{
prevLabel
}
>
...
...
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