Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add data fetching error state to txs page #284

Merged
merged 2 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Improvements

- [#284](https://github.com/alleslabs/celatone-frontend/pull/284) Add data fetching error state to txs page
- [#281](https://github.com/alleslabs/celatone-frontend/pull/281) Change Osmosis mainnet GraphQL
- [#251](https://github.com/alleslabs/celatone-frontend/pull/251) Refactor Code and Contract tables into general components
- [#252](https://github.com/alleslabs/celatone-frontend/pull/252) Refactor Empty State image source logic
Expand Down
11 changes: 10 additions & 1 deletion src/lib/pages/txs/components/TxsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const TxsTable = ({ isViewMore }: TxsTableProps) => {
},
});

const { data: txs, isLoading } = useTxs(offset, pageSize);
const { data: txs, isLoading, error } = useTxs(offset, pageSize);

const onPageChange = (nextPage: number) => {
setCurrentPage(nextPage);
Expand All @@ -48,6 +48,15 @@ export const TxsTable = ({ isViewMore }: TxsTableProps) => {
if (!isViewMore) setPageSize(10);
setCurrentPage(1);
}, [chainId, isViewMore, setCurrentPage, setPageSize]);
// TODO - Might consider adding this state in all transaction table
if (error)
return (
<EmptyState
withBorder
imageVariant="not-found"
message="There is an error during fetching transactions."
/>
);
return (
<>
<TransactionsTable
Expand Down