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
e9297935
Commit
e9297935
authored
May 15, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skeleton for tx details
parent
aa64056d
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
88 deletions
+90
-88
[hash].tsx
pages/tx/[hash].tsx
+7
-2
Transaction.tsx
ui/pages/Transaction.tsx
+7
-4
TxDetails.tsx
ui/tx/TxDetails.tsx
+74
-43
TxDetailsSkeleton.tsx
ui/tx/details/TxDetailsSkeleton.tsx
+0
-39
useFetchTxInfo.tsx
ui/tx/useFetchTxInfo.tsx
+2
-0
No files found.
pages/tx/[hash].tsx
View file @
e9297935
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/tx/getSeo
'
;
import
Transaction
from
'
ui/pages/Transaction
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
const
Transaction
=
dynamic
(()
=>
import
(
'
ui/pages/Transaction
'
),
{
ssr
:
false
});
const
TransactionPage
:
NextPage
<
RoutedQuery
<
'
/tx/[hash]
'
>>
=
({
hash
}:
RoutedQuery
<
'
/tx/[hash]
'
>
)
=>
{
const
{
title
,
description
}
=
getSeo
({
hash
});
...
...
@@ -15,7 +18,9 @@ const TransactionPage: NextPage<RoutedQuery<'/tx/[hash]'>> = ({ hash }: RoutedQu
<
title
>
{
title
}
</
title
>
<
meta
name=
"description"
content=
{
description
}
/>
</
Head
>
<
Transaction
/>
<
Page
>
<
Transaction
/>
</
Page
>
</>
);
};
...
...
ui/pages/Transaction.tsx
View file @
e9297935
...
...
@@ -8,9 +8,9 @@ import useApiQuery from 'lib/api/useApiQuery';
import
{
useAppContext
}
from
'
lib/appContext
'
;
import
networkExplorers
from
'
lib/networks/networkExplorers
'
;
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
{
TX
}
from
'
stubs/tx
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
import
LinkExternal
from
'
ui/shared/LinkExternal
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
RoutedTabs
from
'
ui/shared/RoutedTabs/RoutedTabs
'
;
import
TxDetails
from
'
ui/tx/TxDetails
'
;
...
...
@@ -38,7 +38,10 @@ const TransactionPageContent = () => {
const
{
data
}
=
useApiQuery
(
'
tx
'
,
{
pathParams
:
{
hash
},
queryOptions
:
{
enabled
:
Boolean
(
hash
)
},
queryOptions
:
{
enabled
:
Boolean
(
hash
),
placeholderData
:
TX
,
},
});
const
explorersLinks
=
networkExplorers
...
...
@@ -66,7 +69,7 @@ const TransactionPageContent = () => {
);
return
(
<
Page
>
<>
<
TextAd
mb=
{
6
}
/>
<
PageTitle
text=
"Transaction details"
...
...
@@ -75,7 +78,7 @@ const TransactionPageContent = () => {
backLinkLabel=
"Back to transactions list"
/>
<
RoutedTabs
tabs=
{
TABS
}
/>
</
Page
>
</>
);
};
...
...
ui/tx/TxDetails.tsx
View file @
e9297935
This diff is collapsed.
Click to expand it.
ui/tx/details/TxDetailsSkeleton.tsx
deleted
100644 → 0
View file @
aa64056d
import
{
Grid
,
GridItem
,
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
DetailsSkeletonRow
from
'
ui/shared/skeletons/DetailsSkeletonRow
'
;
const
TxDetailsSkeleton
=
()
=>
{
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"
pt=
{
{
base
:
1
,
lg
:
2
}
}
>
<
DetailsSkeletonRow
/>
<
DetailsSkeletonRow
w=
"20%"
/>
<
DetailsSkeletonRow
w=
"50%"
/>
<
DetailsSkeletonRow
/>
<
DetailsSkeletonRow
w=
"70%"
/>
<
DetailsSkeletonRow
w=
"70%"
/>
{
sectionGap
}
<
DetailsSkeletonRow
w=
"40%"
/>
<
DetailsSkeletonRow
w=
"40%"
/>
<
DetailsSkeletonRow
w=
"40%"
/>
<
DetailsSkeletonRow
w=
"40%"
/>
<
DetailsSkeletonRow
w=
"40%"
/>
{
sectionGap
}
<
GridItem
colSpan=
{
{
base
:
undefined
,
lg
:
2
}
}
>
<
Skeleton
h=
{
5
}
borderRadius=
"full"
w=
"100px"
/>
</
GridItem
>
</
Grid
>
);
};
export
default
TxDetailsSkeleton
;
ui/tx/useFetchTxInfo.tsx
View file @
e9297935
...
...
@@ -12,6 +12,7 @@ import delay from 'lib/delay';
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
useSocketChannel
from
'
lib/socket/useSocketChannel
'
;
import
useSocketMessage
from
'
lib/socket/useSocketMessage
'
;
import
{
TX
}
from
'
stubs/tx
'
;
interface
Params
{
onTxStatusUpdate
?:
()
=>
void
;
...
...
@@ -33,6 +34,7 @@ export default function useFetchTxInfo({ onTxStatusUpdate, updateDelay }: Params
queryOptions
:
{
enabled
:
Boolean
(
hash
),
refetchOnMount
:
false
,
placeholderData
:
TX
,
},
});
const
{
data
,
isError
,
isLoading
}
=
queryResult
;
...
...
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