mirror of
https://github.com/jakejarvis/hoot.git
synced 2025-10-18 20:14:25 -04:00
Enhance registration section to display privacy status with icon
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
--accent-cyan: oklch(64% 0.16 195);
|
||||
--accent-slate: oklch(48% 0 0);
|
||||
|
||||
/* Section accent glow (light) */
|
||||
/* Section accent glows */
|
||||
--glow-blue: radial-gradient(closest-side, var(--accent-blue), transparent);
|
||||
--glow-cyan: radial-gradient(closest-side, var(--accent-cyan), transparent);
|
||||
--glow-purple: radial-gradient(
|
||||
@@ -152,23 +152,6 @@
|
||||
--accent-orange: oklch(86% 0.14 70);
|
||||
--accent-cyan: oklch(78% 0.12 195);
|
||||
--accent-slate: oklch(81% 0 54.26);
|
||||
|
||||
/* Section accent glow (dark) */
|
||||
--glow-blue: radial-gradient(closest-side, var(--accent-blue), transparent);
|
||||
--glow-cyan: radial-gradient(closest-side, var(--accent-cyan), transparent);
|
||||
--glow-purple: radial-gradient(
|
||||
closest-side,
|
||||
var(--accent-purple),
|
||||
transparent
|
||||
);
|
||||
--glow-green: radial-gradient(closest-side, var(--accent-green), transparent);
|
||||
--glow-orange: radial-gradient(
|
||||
closest-side,
|
||||
var(--accent-orange),
|
||||
transparent
|
||||
);
|
||||
--glow-pink: radial-gradient(closest-side, var(--accent-pink), transparent);
|
||||
--glow-slate: radial-gradient(closest-side, var(--accent-slate), transparent);
|
||||
}
|
||||
|
||||
@layer base {
|
||||
|
@@ -37,7 +37,6 @@ describe("exportDomainData", () => {
|
||||
isRegistered: true,
|
||||
domain: "example.com",
|
||||
tld: "com",
|
||||
fetchedAt: "2021-01-01",
|
||||
source: "rdap",
|
||||
registrar: { name: "Test Registrar" },
|
||||
warnings: [],
|
||||
|
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { BadgeCheck, ExternalLink } from "lucide-react";
|
||||
import { BadgeCheck, ExternalLink, HatGlasses } from "lucide-react";
|
||||
import { ErrorWithRetry } from "@/components/domain/error-with-retry";
|
||||
import { Favicon } from "@/components/domain/favicon";
|
||||
import { KeyValue } from "@/components/domain/key-value";
|
||||
@@ -45,10 +45,10 @@ export function RegistrationSection({
|
||||
isError: boolean;
|
||||
onRetryAction: () => void;
|
||||
}) {
|
||||
const registrar = data?.registrarProvider ?? null;
|
||||
const registrant: RegistrantView | null = data
|
||||
? extractRegistrantView(data)
|
||||
: null;
|
||||
|
||||
return (
|
||||
<Section
|
||||
{...SECTION_DEFS.registration}
|
||||
@@ -59,19 +59,19 @@ export function RegistrationSection({
|
||||
{isLoading ? (
|
||||
<>
|
||||
<KeyValueSkeleton label="Registrar" withLeading withSuffix />
|
||||
<KeyValueSkeleton label="Registrant" />
|
||||
<KeyValueSkeleton label="Created" />
|
||||
<KeyValueSkeleton label="Expires" withSuffix />
|
||||
<KeyValueSkeleton label="Registrant" />
|
||||
</>
|
||||
) : data ? (
|
||||
<>
|
||||
<KeyValue
|
||||
label="Registrar"
|
||||
value={registrar?.name || ""}
|
||||
value={data?.registrarProvider?.name || ""}
|
||||
leading={
|
||||
registrar?.domain ? (
|
||||
data?.registrarProvider?.domain ? (
|
||||
<Favicon
|
||||
domain={registrar.domain}
|
||||
domain={data.registrarProvider.domain}
|
||||
size={16}
|
||||
className="rounded"
|
||||
/>
|
||||
@@ -110,9 +110,16 @@ export function RegistrationSection({
|
||||
|
||||
<KeyValue
|
||||
label="Registrant"
|
||||
value={formatRegistrant(
|
||||
registrant ?? { organization: "Unavailable", country: "" },
|
||||
)}
|
||||
value={
|
||||
data?.privacyEnabled || !registrant
|
||||
? "Hidden"
|
||||
: formatRegistrant(registrant)
|
||||
}
|
||||
leading={
|
||||
data?.privacyEnabled || !registrant ? (
|
||||
<HatGlasses className="stroke-muted-foreground" />
|
||||
) : undefined
|
||||
}
|
||||
/>
|
||||
|
||||
<KeyValue
|
||||
|
@@ -1,8 +1,7 @@
|
||||
import { z } from "zod";
|
||||
import { ProviderRefSchema } from "../internal/provider";
|
||||
|
||||
// typed from rdapper
|
||||
// https://chatgpt.com/s/t_68daacac17b88191b9dda5c878327209
|
||||
// https://github.com/jakejarvis/rdapper/blob/main/src/types.ts
|
||||
export const RegistrationSchema = z.object({
|
||||
domain: z.string(),
|
||||
tld: z.string(),
|
||||
@@ -11,7 +10,6 @@ export const RegistrationSchema = z.object({
|
||||
unicodeName: z.string().optional(),
|
||||
punycodeName: z.string().optional(),
|
||||
registry: z.string().optional(),
|
||||
|
||||
registrar: z
|
||||
.object({
|
||||
name: z.string().optional(),
|
||||
@@ -21,9 +19,7 @@ export const RegistrationSchema = z.object({
|
||||
phone: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
|
||||
reseller: z.string().optional(),
|
||||
|
||||
statuses: z
|
||||
.array(
|
||||
z.object({
|
||||
@@ -33,14 +29,11 @@ export const RegistrationSchema = z.object({
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
|
||||
creationDate: z.string().optional(),
|
||||
updatedDate: z.string().optional(),
|
||||
expirationDate: z.string().optional(),
|
||||
deletionDate: z.string().optional(),
|
||||
|
||||
transferLock: z.boolean().optional(),
|
||||
|
||||
dnssec: z
|
||||
.object({
|
||||
enabled: z.boolean(),
|
||||
@@ -56,7 +49,6 @@ export const RegistrationSchema = z.object({
|
||||
.optional(),
|
||||
})
|
||||
.optional(),
|
||||
|
||||
nameservers: z
|
||||
.array(
|
||||
z.object({
|
||||
@@ -66,7 +58,6 @@ export const RegistrationSchema = z.object({
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
|
||||
contacts: z
|
||||
.array(
|
||||
z.object({
|
||||
@@ -94,15 +85,10 @@ export const RegistrationSchema = z.object({
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
|
||||
privacyEnabled: z.boolean().optional(),
|
||||
whoisServer: z.string().optional(),
|
||||
rdapServers: z.array(z.string()).optional(),
|
||||
rawRdap: z.unknown().optional(),
|
||||
rawWhois: z.string().optional(),
|
||||
|
||||
source: z.enum(["rdap", "whois"]),
|
||||
fetchedAt: z.string(), // ISO 8601
|
||||
|
||||
warnings: z.array(z.string()).optional(),
|
||||
|
||||
registrarProvider: ProviderRefSchema,
|
||||
|
@@ -12,7 +12,6 @@ export const DomainExportSchema = z.object({
|
||||
domain: true,
|
||||
unicodeName: true,
|
||||
punycodeName: true,
|
||||
fetchedAt: true,
|
||||
warnings: true,
|
||||
})
|
||||
.transform((r) => ({
|
||||
|
@@ -66,7 +66,6 @@ describe("getSeo", () => {
|
||||
meta: null,
|
||||
robots: null,
|
||||
preview: null,
|
||||
timestamps: { fetchedAt: new Date().toISOString() },
|
||||
source: { finalUrl: `https://example.com/`, status: 200 },
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user