From 5ef1558c58729383465ebd8d0d054c3f3f57a0f4 Mon Sep 17 00:00:00 2001 From: Juan Cazala Date: Wed, 22 Dec 2021 18:55:58 -0300 Subject: [PATCH] feat: error boundary (#495) * fix: typescript path * fix: ignore .vscode * feat: added error boundary, fixed empty estate detail * chore: remove comments from docs --- .gitignore | 1 + .vscode/settings.json | 9 ------ webapp/.vscode/settings.json | 4 --- webapp/src/components/AssetPage/AssetPage.tsx | 21 +++++++------ .../AssetPage/ErrorBoundary/ErrorBoundary.tsx | 31 +++++++++++++++++++ .../ErrorBoundary/ErrorBoundary.types.ts | 5 +++ .../AssetPage/ErrorBoundary/index.ts | 2 ++ .../AssetPage/EstateDetail/EstateDetail.css | 31 +++++++++++++++++++ .../AssetPage/EstateDetail/EstateDetail.tsx | 20 ++++++++++-- .../src/modules/translation/locales/en.json | 6 ++++ .../src/modules/translation/locales/es.json | 6 ++++ .../src/modules/translation/locales/zh.json | 6 ++++ 12 files changed, 118 insertions(+), 24 deletions(-) delete mode 100644 .vscode/settings.json delete mode 100644 webapp/.vscode/settings.json create mode 100644 webapp/src/components/AssetPage/ErrorBoundary/ErrorBoundary.tsx create mode 100644 webapp/src/components/AssetPage/ErrorBoundary/ErrorBoundary.types.ts create mode 100644 webapp/src/components/AssetPage/ErrorBoundary/index.ts diff --git a/.gitignore b/.gitignore index 5219d6c7a6..630f567006 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,4 @@ indexer/src/entities indexer/src/data/addresses.ts indexer/subgraph.yaml +.vscode \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 32f6d1e660..0000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "typescript.tsdk": "node_modules/typescript/lib", - "prettier.printWidth": 80, - "prettier.singleQuote": true, - "prettier.semi": false, - "search.followSymlinks": false, - "editor.tabSize": 2, - "editor.formatOnSave": true -} diff --git a/webapp/.vscode/settings.json b/webapp/.vscode/settings.json deleted file mode 100644 index 3a19d2f713..0000000000 --- a/webapp/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "editor.formatOnSave": true, - "typescript.tsdk": "node_modules/typescript/lib" -} diff --git a/webapp/src/components/AssetPage/AssetPage.tsx b/webapp/src/components/AssetPage/AssetPage.tsx index 4bbbaa5a8b..725329a73b 100644 --- a/webapp/src/components/AssetPage/AssetPage.tsx +++ b/webapp/src/components/AssetPage/AssetPage.tsx @@ -8,6 +8,7 @@ import { Navigation } from '../Navigation' import { AssetProviderPage } from '../AssetProviderPage' import { NFTDetail } from '../Vendor/NFTDetail' import { ItemDetail } from './ItemDetail' +import { ErrorBoundary } from './ErrorBoundary' import { Props } from './AssetPage.types' import './AssetPage.css' @@ -18,15 +19,17 @@ const AssetPage = (props: Props) => { - - {asset => - type === AssetType.NFT ? ( - } /> - ) : AssetType.ITEM ? ( - } /> - ) : null - } - + + + {asset => + type === AssetType.NFT ? ( + } /> + ) : AssetType.ITEM ? ( + } /> + ) : null + } + +