From de6f3f828327d171c9e03fd7986921653996d297 Mon Sep 17 00:00:00 2001 From: Jamie Barton Date: Tue, 13 Aug 2024 08:32:36 +0100 Subject: [PATCH 1/5] prevent exception --- packages/nameguard-react/src/components/Report/LabelList.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nameguard-react/src/components/Report/LabelList.tsx b/packages/nameguard-react/src/components/Report/LabelList.tsx index 0813234e4..dc08d6df9 100644 --- a/packages/nameguard-react/src/components/Report/LabelList.tsx +++ b/packages/nameguard-react/src/components/Report/LabelList.tsx @@ -8,7 +8,7 @@ type LabelListProps = { }; export function LabelList({ items = [] }: LabelListProps) { - const rawLabels = items.map((i) => i.label) ?? []; + const rawLabels = items?.map((i) => i.label) ?? []; return items?.map((label, index) => ( Date: Tue, 13 Aug 2024 08:47:21 +0100 Subject: [PATCH 2/5] hide inspection report --- .../src/components/Report/Report.tsx | 21 +++++++++++-------- .../src/components/Tooltip/Tooltip.tsx | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/nameguard-react/src/components/Report/Report.tsx b/packages/nameguard-react/src/components/Report/Report.tsx index e8d95ef2d..538159f1b 100644 --- a/packages/nameguard-react/src/components/Report/Report.tsx +++ b/packages/nameguard-react/src/components/Report/Report.tsx @@ -121,14 +121,12 @@ export const Report = ({ - {isLoading && !hadLoadingError && normalizationUnknown && ( )} {isLoading && !hadLoadingError && !normalizationUnknown && ( )} - {hadLoadingError && } {data && ( @@ -145,14 +143,19 @@ export const Report = ({ ))} -
-

- Name inspection -

- - -
+ + )} + {data && data.inspected && ( +
+

+ Name inspection +

+ +
+ )} + {data && ( + diff --git a/packages/nameguard-react/src/components/Tooltip/Tooltip.tsx b/packages/nameguard-react/src/components/Tooltip/Tooltip.tsx index 49dfb8331..dad22eee8 100644 --- a/packages/nameguard-react/src/components/Tooltip/Tooltip.tsx +++ b/packages/nameguard-react/src/components/Tooltip/Tooltip.tsx @@ -28,7 +28,7 @@ export function Tooltip({ placement = "top", /* - Props are applied to the Float component, + Props are applied to the Float component, which is a wrapper for the tooltip "children". */ ...props From 521ae979d91c928ced2694f3263d1f39189e817e Mon Sep 17 00:00:00 2001 From: Jamie Barton Date: Mon, 19 Aug 2024 15:00:01 +0100 Subject: [PATCH 3/5] add long domain to test --- .../nameguard-react/src/components/Search/SearchEmptyState.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nameguard-react/src/components/Search/SearchEmptyState.tsx b/packages/nameguard-react/src/components/Search/SearchEmptyState.tsx index f211b54fb..1beb53982 100644 --- a/packages/nameguard-react/src/components/Search/SearchEmptyState.tsx +++ b/packages/nameguard-react/src/components/Search/SearchEmptyState.tsx @@ -26,6 +26,7 @@ const examples = [ "unknоwn.eth", "john🇺🇸", "7️⃣7️⃣7️⃣.eth", + "testingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtestingtesting.eth", ].map((name) => buildENSName(name)); export const SearchEmptyState = () => { From 030499954052825b9132f569b60e4ed05a00b1bb Mon Sep 17 00:00:00 2001 From: "lightwalker.eth" <126201998+lightwalker-eth@users.noreply.github.com> Date: Thu, 22 Aug 2024 13:56:30 +0300 Subject: [PATCH 4/5] Refine uninspected names UI (#356) * labels passed into LabelList are never undefined * Refine example uninspected name --- .../nameguard-react/src/components/Report/LabelList.tsx | 8 ++++---- .../src/components/Search/SearchEmptyState.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/nameguard-react/src/components/Report/LabelList.tsx b/packages/nameguard-react/src/components/Report/LabelList.tsx index dc08d6df9..307074102 100644 --- a/packages/nameguard-react/src/components/Report/LabelList.tsx +++ b/packages/nameguard-react/src/components/Report/LabelList.tsx @@ -1,16 +1,16 @@ import React from "react"; -import type { NameGuardReport } from "@namehash/nameguard"; +import type { LabelGuardReport } from "@namehash/nameguard"; import { LabelListItem } from "./LabelListItem"; type LabelListProps = { - items?: NameGuardReport["labels"]; + items: LabelGuardReport[]; }; export function LabelList({ items = [] }: LabelListProps) { - const rawLabels = items?.map((i) => i.label) ?? []; + const rawLabels = items.map((i) => i.label); - return items?.map((label, index) => ( + return items.map((label, index) => ( buildENSName(name)); export const SearchEmptyState = () => { From bedf683c707fc79c7546a07a1fa72e9f69c3c076 Mon Sep 17 00:00:00 2001 From: "lightwalker.eth" <126201998+lightwalker-eth@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:11:39 +0300 Subject: [PATCH 5/5] Add changeset --- .changeset/thin-eels-burn.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/thin-eels-burn.md diff --git a/.changeset/thin-eels-burn.md b/.changeset/thin-eels-burn.md new file mode 100644 index 000000000..c020770ef --- /dev/null +++ b/.changeset/thin-eels-burn.md @@ -0,0 +1,5 @@ +--- +"@namehash/nameguard-react": patch +--- + +Add support for uninspected NameGuard reports.