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

Refine Entire Platform To Support Uninspected Names in NameGuard #350

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
5 changes: 5 additions & 0 deletions .changeset/thin-eels-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@namehash/nameguard-react": patch
---

Add support for uninspected NameGuard reports.
Original file line number Diff line number Diff line change
@@ -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) => (
<LabelListItem
key={index}
index={index}
Expand Down
21 changes: 12 additions & 9 deletions packages/nameguard-react/src/components/Report/Report.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,12 @@ export const Report = ({
<ExternalLinks title="View name in" links={externalLinks} />
</div>
</div>

{isLoading && !hadLoadingError && normalizationUnknown && (
<LoadingSkeleton parsedName={parsedName} />
)}
{isLoading && !hadLoadingError && !normalizationUnknown && (
<LoadingSkeleton parsedName={parsedName} />
)}

{hadLoadingError && <ReportError />}

{data && (
Expand All @@ -145,14 +143,19 @@ export const Report = ({
))}
</div>
</div>
<div className="space-y-4 md:space-y-5">
<p className="text-black font-semibold text-lg leading-6">
Name inspection
</p>

<LabelList items={data.labels} />
</div>
</Fragment>
)}
{data && data.inspected && (
<div className="space-y-4 md:space-y-5">
<p className="text-black font-semibold text-lg leading-6">
Name inspection
</p>

<LabelList items={data.labels} />
</div>
)}
{data && (
<Fragment>
<FeedbackNotice onChatClick={openChatModal} />
<ReportFooter />
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const examples = [
"unknоwn.eth",
"john🇺🇸",
"7️⃣7️⃣7️⃣.eth",
"extremelylongnamethatgoesonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandonandon.eth",
].map((name) => buildENSName(name));

export const SearchEmptyState = () => {
lightwalker-eth marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading