Skip to content

Commit

Permalink
chore(explorer): remove skelton loader after error (#2423)
Browse files Browse the repository at this point in the history
  • Loading branch information
sstraatemans authored Jul 20, 2024
1 parent 0450bf3 commit 3bd5cb5
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-items-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kadena/explorer': patch
---

remove skeleton loader when account transactions fails to load
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { AccountTransfersQuery, Transfer } from '@/__generated__/sdk';
import { useAccountTransfersQuery } from '@/__generated__/sdk';
import { usePagination } from '@/hooks/usePagination';
import { graphqlIdFor } from '@/utils/graphqlIdFor';
import { Heading, Stack } from '@kadena/kode-ui';
import type { FC } from 'react';
import React, { useEffect, useState } from 'react';
import CompactTable from '../compact-table/compact-table';
Expand Down Expand Up @@ -52,6 +53,13 @@ const AccountTransfersTable: FC<{ accountName: string }> = ({

if (innerData.node?.__typename !== 'FungibleAccount') return null;

if (error)
return (
<Stack justifyContent="center">
<Heading as="h5">There was an issue with loading the results</Heading>
</Stack>
);

return (
<CompactTable
setPage={handlePageChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export const loadingData: AccountQuery = {
// transactions: {
// totalCount: 0,
// },
transfers: {
totalCount: 0,
},
// transfers: {
// totalCount: 0,
// },
accountName: '0',
totalBalance: 0,
chainAccounts: [
Expand Down
1 change: 1 addition & 0 deletions packages/apps/explorer/src/components/logo/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const Logo: FC = () => {

return (
<svg
style={{ width: '100%' }}
data-style="kdacolor"
width="230"
height="40"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const searchInputClass = style([
{
height: 46,
border: 'none',

overflowX: 'auto',
selectors: {
'&::placeholder': {
fontFamily: tokens.kda.foundation.typography.family.primaryFont,
Expand Down
6 changes: 3 additions & 3 deletions packages/apps/explorer/src/graphql/queries/account.graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export const account: DocumentNode = gql`
# transactions {
# totalCount
# }
transfers {
totalCount
}
# transfers {
# totalCount
# }
}
}
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,7 @@ const Account: FC = () => {
>
<AccountTransactionsTable accountName={accountName} />
</TabItem> */}
<TabItem
title={`Transfers (${fungibleAccount?.transfers.totalCount})`}
key="Transfers"
>
<TabItem title={`Transfers`} key="Transfers">
<AccountTransfersTable accountName={accountName} />
</TabItem>
</Tabs>
Expand Down

0 comments on commit 3bd5cb5

Please sign in to comment.