Skip to content

Commit a0126b2

Browse files
Y3drknotrab
andauthored
feat(ensadmin): Apply namehash-ui package (#1524)
Co-authored-by: Jamie Barton <jamie@notrab.dev>
1 parent d27f02e commit a0126b2

63 files changed

Lines changed: 494 additions & 1671 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/curly-heads-grab.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@namehash/namehash-ui": patch
3+
---
4+
5+
Refines the package's setup (CSS-related & prepublish scripts) and components (interfaces).

.changeset/green-cows-find.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"ensadmin": patch
3+
---
4+
5+
Applies `@namehash/namehash-ui`'s components across the app.

apps/ensadmin/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@graphiql/react": "0.37.1",
3333
"@graphiql/toolkit": "0.11.3",
3434
"@icons-pack/react-simple-icons": "^13.7.0",
35+
"@namehash/namehash-ui": "workspace:*",
3536
"@ponder/utils": "catalog:",
3637
"@radix-ui/react-avatar": "^1.1.3",
3738
"@radix-ui/react-checkbox": "^1.3.3",
@@ -54,16 +55,16 @@
5455
"date-fns": "catalog:",
5556
"graphiql": "5.2.0",
5657
"graphql": "^16.10.0",
57-
"lucide-react": "^0.548.0",
58+
"lucide-react": "catalog:",
5859
"next": "16.0.10",
5960
"next-themes": "^0.4.6",
6061
"react": "19.2.1",
6162
"react-dom": "19.2.1",
6263
"rooks": "^8.4.0",
6364
"serve": "^14.2.5",
6465
"sonner": "^2.0.3",
65-
"tailwind-merge": "^3.4.0",
66-
"tailwindcss-animate": "^1.0.7",
66+
"tailwind-merge": "catalog:",
67+
"tailwindcss-animate": "catalog:",
6768
"viem": "catalog:"
6869
},
6970
"devDependencies": {
@@ -73,7 +74,7 @@
7374
"@types/react-dom": "19.2.3",
7475
"@tailwindcss/postcss": "^4.1.18",
7576
"postcss": "^8.5.6",
76-
"tailwindcss": "^4.1.18",
77+
"tailwindcss": "catalog:",
7778
"typescript": "^5",
7879
"vitest": "catalog:"
7980
}

apps/ensadmin/src/app/@actions/api/subgraph/page.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"use client";
22

3-
import { CopyButton } from "@/components/copy-button";
3+
import { CopyButton } from "@namehash/namehash-ui";
4+
import { CheckIcon, CopyIcon } from "lucide-react";
5+
import * as React from "react";
6+
47
import { useSelectedConnection } from "@/hooks/active/use-selected-connection";
58

69
export default function ActionsSubgraphCompatPage() {
@@ -15,7 +18,13 @@ export default function ActionsSubgraphCompatPage() {
1518
return (
1619
<div className="flex w-full max-w-md items-center space-x-2">
1720
<span className="font-mono text-xs select-none text-gray-500">{url}</span>
18-
<CopyButton value={url} message="URL copied to clipboard!" />
21+
<CopyButton
22+
value={url}
23+
message="URL copied to clipboard!"
24+
successIcon={<CheckIcon className="h-4 w-4" />}
25+
icon={<CopyIcon className="h-4 w-4" />}
26+
showToast={true}
27+
/>
1928
</div>
2029
);
2130
}

apps/ensadmin/src/app/@actions/name/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"use client";
22

3+
import { getEnsManagerNameDetailsUrl } from "@namehash/namehash-ui";
34
import { useSearchParams } from "next/navigation";
45

56
import type { Name } from "@ensnode/ensnode-sdk";
67

78
import { ExternalLinkWithIcon } from "@/components/link";
89
import { Button } from "@/components/ui/button";
910
import { useNamespace } from "@/hooks/async/use-namespace";
10-
import { buildExternalEnsAppProfileUrl } from "@/lib/namespace-utils";
1111

1212
export default function ActionsNamePage() {
1313
const searchParams = useSearchParams();
@@ -17,8 +17,7 @@ export default function ActionsNamePage() {
1717

1818
const { data: namespace } = useNamespace();
1919

20-
const ensAppProfileUrl =
21-
name && namespace ? buildExternalEnsAppProfileUrl(name, namespace) : null;
20+
const ensAppProfileUrl = name && namespace ? getEnsManagerNameDetailsUrl(name, namespace) : null;
2221

2322
if (!ensAppProfileUrl) return null;
2423

apps/ensadmin/src/app/@breadcrumbs/name/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"use client";
22

3+
import { NameDisplay } from "@namehash/namehash-ui";
34
import { useSearchParams } from "next/navigation";
45

56
import type { Name } from "@ensnode/ensnode-sdk";
67

78
import BreadcrumbsGroup from "@/components/breadcrumbs/group";
8-
import { NameDisplay } from "@/components/identity/utils";
99
import {
1010
BreadcrumbItem,
1111
BreadcrumbLink,

apps/ensadmin/src/app/globals.css

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@import "@namehash/namehash-ui/styles.css";
12
@import "tailwindcss";
23
@config "../../tailwind.config.ts";
34

@@ -69,72 +70,6 @@
6970

7071
--sidebar-ring: 217.2 91.2% 59.8%;
7172
}
72-
73-
.dark {
74-
--background: 222.2 84% 4.9%;
75-
76-
--foreground: 210 40% 98%;
77-
78-
--card: 222.2 84% 4.9%;
79-
80-
--card-foreground: 210 40% 98%;
81-
82-
--popover: 222.2 84% 4.9%;
83-
84-
--popover-foreground: 210 40% 98%;
85-
86-
--primary: 210 40% 98%;
87-
88-
--primary-foreground: 222.2 47.4% 11.2%;
89-
90-
--secondary: 217.2 32.6% 17.5%;
91-
92-
--secondary-foreground: 210 40% 98%;
93-
94-
--muted: 217.2 32.6% 17.5%;
95-
96-
--muted-foreground: 215 20.2% 65.1%;
97-
98-
--accent: 217.2 32.6% 17.5%;
99-
100-
--accent-foreground: 210 40% 98%;
101-
102-
--destructive: 0 62.8% 30.6%;
103-
104-
--destructive-foreground: 210 40% 98%;
105-
106-
--border: 217.2 32.6% 17.5%;
107-
108-
--input: 217.2 32.6% 17.5%;
109-
110-
--ring: 212.7 26.8% 83.9%;
111-
112-
--chart-1: 220 70% 50%;
113-
114-
--chart-2: 160 60% 45%;
115-
116-
--chart-3: 30 80% 55%;
117-
118-
--chart-4: 280 65% 60%;
119-
120-
--chart-5: 340 75% 55%;
121-
122-
--sidebar-background: 240 5.9% 10%;
123-
124-
--sidebar-foreground: 240 4.8% 95.9%;
125-
126-
--sidebar-primary: 224.3 76.3% 48%;
127-
128-
--sidebar-primary-foreground: 0 0% 100%;
129-
130-
--sidebar-accent: 240 3.7% 15.9%;
131-
132-
--sidebar-accent-foreground: 240 4.8% 95.9%;
133-
134-
--sidebar-border: 240 3.7% 15.9%;
135-
136-
--sidebar-ring: 217.2 91.2% 59.8%;
137-
}
13873
}
13974

14075
@layer base {
@@ -147,15 +82,6 @@
14782
}
14883
}
14984

150-
@layer base {
151-
* {
152-
@apply border-border;
153-
}
154-
body {
155-
@apply bg-background text-foreground;
156-
}
157-
}
158-
15985
@layer utilities {
16086
/* Hide scrollbar for Chrome, Safari, and Opera */
16187
.no-scrollbar::-webkit-scrollbar {

apps/ensadmin/src/app/inspect/primary-name/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import { getChainName } from "@namehash/namehash-ui";
34
import { useSearchParams } from "next/navigation";
45
import { useState } from "react";
56
import { useDebouncedValue } from "rooks";
@@ -26,7 +27,6 @@ import {
2627
SelectTrigger,
2728
SelectValue,
2829
} from "@/components/ui/select";
29-
import { getChainName } from "@/lib/namespace-utils";
3030

3131
const EXAMPLE_INPUT = [
3232
{ address: "0x179A862703a4adfb29896552DF9e307980D19285", chainId: "1" }, // greg mainnet

apps/ensadmin/src/app/mock/display-identity/page.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
"use client";
22

3+
import {
4+
DisplayIdentity,
5+
getChainName,
6+
getEnsManagerAddressDetailsUrl,
7+
} from "@namehash/namehash-ui";
38
import { useState } from "react";
49
import { type Address, isAddress } from "viem";
510

@@ -22,7 +27,6 @@ import {
2227
uniq,
2328
} from "@ensnode/ensnode-sdk";
2429

25-
import { DisplayIdentity } from "@/components/identity";
2630
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
2731
import { Checkbox } from "@/components/ui/checkbox";
2832
import { Input } from "@/components/ui/input";
@@ -33,7 +37,6 @@ import {
3337
SelectTrigger,
3438
SelectValue,
3539
} from "@/components/ui/select";
36-
import { getChainName } from "@/lib/namespace-utils";
3740

3841
const DEFAULT_NAMESPACE_ID: ENSNamespaceId = ENSNamespaceIds.Mainnet;
3942
const DEFAULT_RESOLUTION_STATUS: ResolutionStatusId = ResolutionStatusIds.Named;
@@ -315,6 +318,10 @@ export default function MockDisplayIdentityPage() {
315318
identity={selectedIdentity}
316319
namespaceId={selectedNamespaceId}
317320
withLink={withLink}
321+
identityLinkDetails={{
322+
isExternal: true,
323+
link: getEnsManagerAddressDetailsUrl(selectedIdentity.address, selectedNamespaceId),
324+
}}
318325
withTooltip={withTooltip}
319326
withAvatar={withAvatar}
320327
/>

apps/ensadmin/src/app/mock/relative-time/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
"use client";
22

3+
import { AbsoluteTime, InfoIcon, RelativeTime } from "@namehash/namehash-ui";
34
import { CheckIcon, X as XIcon } from "lucide-react";
45
import { useMemo, useState } from "react";
56

67
import type { UnixTimestamp } from "@ensnode/ensnode-sdk";
78

89
import mockDataJson from "@/app/mock/relative-time/data.json";
9-
import { AbsoluteTime, RelativeTime } from "@/components/datetime-utils";
10-
import { InfoIcon } from "@/components/icons/InfoIcon";
1110
import { Button } from "@/components/ui/button";
1211
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
1312
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
@@ -226,7 +225,9 @@ const RelativeTimePropCheck = ({
226225
<p className="text-sm leading-6 font-semibold text-gray-500">{checkName}</p>
227226
<div className={checksWrapperStyles}>
228227
<Tooltip>
229-
<TooltipTrigger asChild>{<InfoIcon className="shrink-0" />}</TooltipTrigger>
228+
<TooltipTrigger asChild>
229+
{<InfoIcon className="shrink-0 text-[#9CA3AF]" />}
230+
</TooltipTrigger>
230231
<TooltipContent
231232
side="top"
232233
className="bg-gray-50 text-sm text-black shadow-md outline-hidden max-w-[275px]"

0 commit comments

Comments
 (0)