Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
refactor: remove unused VerifiedIcon and clean up related code (#2686)
Browse files Browse the repository at this point in the history
### TL;DR

This pull request removes support for the verification of chains across the dashboard layouts and chain list components.

### What changed?

- Deleted all instances of the `VerifiedIcon` and its corresponding logic from the dashboard layout and chain list components.

### How to test?

1. Navigate to the dashboard layout.
2. Ensure no verified badge or icon appears for any chain.
3. Check the chain list components to confirm they no longer display the verified icon or associated logic.

### Why make this change?

This change simplifies the UI by removing the verified chain feature, which is no longer in use.

---

<!-- start pr-codex -->

## PR-Codex overview
The focus of this PR is to remove the `VerifiedIcon` component and related logic from chain-related components.

### Detailed summary
- Removed `VerifiedIcon` component import and references from `layout.tsx`, `chainlist-row.tsx`, and `chainlist-card.tsx`
- Updated conditional rendering logic related to `VerifiedIcon` in `chainlist-row.tsx` and `chainlist-card.tsx`

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
  • Loading branch information
jnsdls committed Jun 18, 2024
1 parent 61b83a0 commit 6296bc1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 41 deletions.
13 changes: 0 additions & 13 deletions src/app/(dashboard)/(chain)/[chain_id]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
CircleAlertIcon,
ExternalLinkIcon,
TicketCheckIcon,
VerifiedIcon,
} from "lucide-react";
import { Separator } from "@/components/ui/separator";
import Link from "next/link";
Expand Down Expand Up @@ -132,7 +131,6 @@ export default async function ChainPageLayout({
)}

{/* Chain Name */}

<h1
className={cn(
"font-semibold tracking-tighter text-4xl md:text-6xl",
Expand All @@ -144,17 +142,6 @@ export default async function ChainPageLayout({
</div>

<div className="flex flex-row gap-2 md:gap-4 items-center h-8 mb-4 md:mb-6">
{isVerified && (
<Badge
variant="secondary"
className="text-accent-foreground pointer-events-none flex flex-row items-center h-full gap-1.5 border border-border"
>
<VerifiedIcon className="size-5" />
<span className="font-bold text-xs uppercase">
verified
</span>
</Badge>
)}
{chainMetadata?.gasSponsored && (
<Badge
variant="secondary"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { CircleAlertIcon, TicketCheckIcon, VerifiedIcon } from "lucide-react";
import { CircleAlertIcon, TicketCheckIcon } from "lucide-react";
import Link from "next/link";
import { ChainSupportedService } from "../../../types/chain";
import { ChainIcon } from "../../../components/server/chain-icon";
Expand Down Expand Up @@ -27,7 +27,7 @@ export async function ChainListCard({
iconUrl,
}: ChainListCardProps) {
const chainMetadata = await getChainMetadata(chainId);
const isVerified = !!chainMetadata;

return (
<div className="relative h-full">
<Card className="h-full w-full hover:bg-muted">
Expand Down Expand Up @@ -71,24 +71,13 @@ export async function ChainListCard({
</tbody>
</table>

{(isDeprecated || chainMetadata?.gasSponsored || isVerified) && (
{(isDeprecated || chainMetadata?.gasSponsored) && (
<div className="mt-5 flex gap-5 border-t pt-4">
{!isDeprecated && (
<>
{isVerified && (
<div className="gap-1.5 flex items-center">
<VerifiedIcon className="text-primary-foreground size-5" />
<p className="text-sm">Verified</p>
</div>
)}

{chainMetadata?.gasSponsored && (
<div className="gap-1.5 flex items-center">
<TicketCheckIcon className="text-primary-foreground size-5" />
<p className="text-sm">Gas Sponsored</p>
</div>
)}
</>
{!isDeprecated && chainMetadata?.gasSponsored && (
<div className="gap-1.5 flex items-center">
<TicketCheckIcon className="text-primary-foreground size-5" />
<p className="text-sm">Gas Sponsored</p>
</div>
)}

{isDeprecated && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
CheckIcon,
CircleAlertIcon,
TicketCheckIcon,
VerifiedIcon,
XIcon,
} from "lucide-react";
import Link from "next/link";
Expand Down Expand Up @@ -35,7 +34,6 @@ export async function ChainListRow({
iconUrl,
}: ChainListRowProps) {
const chainMetadata = await getChainMetadata(chainId);
const isVerified = !!chainMetadata;
return (
<tr className="border-b relative hover:bg-secondary">
<TableData>{favoriteButton}</TableData>
Expand All @@ -51,13 +49,7 @@ export async function ChainListRow({
{chainName}
</Link>

{isVerified && (
<ToolTipLabel label="Verified">
<VerifiedIcon className="text-primary-foreground size-5 z-10 " />
</ToolTipLabel>
)}

{chainMetadata?.gasSponsored && (
{!isDeprecated && chainMetadata?.gasSponsored && (
<ToolTipLabel label="Gas Sponsored">
<TicketCheckIcon className="text-primary-foreground size-5 z-10 " />
</ToolTipLabel>
Expand Down

0 comments on commit 6296bc1

Please sign in to comment.