Skip to content

Commit e2a1fe5

Browse files
committed
consolidate gateway navbar
1 parent f07b4b5 commit e2a1fe5

File tree

22 files changed

+194
-403
lines changed

22 files changed

+194
-403
lines changed

apps/dashboard/redirects.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ const projectPageRedirects = [
115115
permanent: false,
116116
source: `${projectRoute}/connect/analytics`,
117117
},
118+
{
119+
destination: `${projectRoute}/insight/:path*`,
120+
permanent: false,
121+
source: `${projectRoute}/gateway/indexer/:path*`,
122+
},
123+
{
124+
destination: `${projectRoute}/rpc/:path*`,
125+
permanent: false,
126+
source: `${projectRoute}/gateway/rpc/:path*`,
127+
},
118128
];
119129

120130
const teamPageRedirects = [

apps/dashboard/src/app/(app)/(dashboard)/(chain)/components/server/products.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ConnectSDKIcon } from "@/icons/ConnectSDKIcon";
22
import { ContractIcon } from "@/icons/ContractIcon";
33
import { EngineIcon } from "@/icons/EngineIcon";
4-
import { InsightIcon } from "@/icons/InsightIcon";
54
import { NebulaIcon } from "@/icons/NebulaIcon";
65
import { PayIcon } from "@/icons/PayIcon";
76
import { RPCIcon } from "@/icons/RPCIcon";
@@ -51,13 +50,6 @@ export const products = [
5150
link: "https://portal.thirdweb.com/payments",
5251
name: "Payments",
5352
},
54-
{
55-
description: "Query and analyze blockchain data",
56-
icon: InsightIcon,
57-
id: "insight",
58-
link: "https://thirdweb.com/insight",
59-
name: "Insight",
60-
},
6153
{
6254
description: "The most powerful AI for interacting with the blockchain",
6355
icon: NebulaIcon,

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectFTUX/ProjectFTUX.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { TypeScriptIcon } from "@/icons/brand-icons/TypeScriptIcon";
1313
import { UnityIcon } from "@/icons/brand-icons/UnityIcon";
1414
import { UnrealIcon } from "@/icons/brand-icons/UnrealIcon";
1515
import { ContractIcon } from "@/icons/ContractIcon";
16-
import { InsightIcon } from "@/icons/InsightIcon";
1716
import { PayIcon } from "@/icons/PayIcon";
1817
import { ClientIDSection } from "./ClientIDSection";
1918
import { SecretKeySection } from "./SecretKeySection";
@@ -111,13 +110,6 @@ function ProductsSection(props: { teamSlug: string; projectSlug: string }) {
111110
icon: ContractIcon,
112111
title: "Contracts",
113112
},
114-
{
115-
description:
116-
"Add indexing capabilities to retrieve real-time onchain data",
117-
href: `/team/${props.teamSlug}/${props.projectSlug}/insight`,
118-
icon: InsightIcon,
119-
title: "Insight",
120-
},
121113
{
122114
description:
123115
"Bridge, swap, and purchase cryptocurrencies with any fiat options or tokens via cross-chain routing",

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
} from "@/components/blocks/full-width-sidebar-layout";
1616
import { BridgeIcon } from "@/icons/BridgeIcon";
1717
import { ContractIcon } from "@/icons/ContractIcon";
18-
import { InsightIcon } from "@/icons/InsightIcon";
1918
import { NebulaIcon } from "@/icons/NebulaIcon";
2019
import { PayIcon } from "@/icons/PayIcon";
2120
import { TokenIcon } from "@/icons/TokenIcon";
@@ -24,6 +23,7 @@ import { WalletProductIcon } from "@/icons/WalletProductIcon";
2423
export function ProjectSidebarLayout(props: {
2524
layoutPath: string;
2625
children: React.ReactNode;
26+
hasEngines: boolean;
2727
}) {
2828
const contentSidebarLinks = [
2929
{
@@ -104,14 +104,20 @@ export function ProjectSidebarLayout(props: {
104104
group: "Scale",
105105
links: [
106106
{
107-
href: `${props.layoutPath}/insight`,
108-
icon: InsightIcon,
109-
label: "Insight",
110-
},
111-
{
112-
href: `${props.layoutPath}/rpc`,
113-
icon: RssIcon,
114-
label: "RPC",
107+
subMenu: {
108+
icon: RssIcon,
109+
label: "Gateway",
110+
},
111+
links: [
112+
{
113+
href: `${props.layoutPath}/gateway/rpc`,
114+
label: "RPC",
115+
},
116+
{
117+
href: `${props.layoutPath}/gateway/indexer`,
118+
label: "Indexer",
119+
},
120+
],
115121
},
116122
// linkely want to move this to `team` level eventually
117123
{

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/overview/engine-instances-table.tsx

Lines changed: 19 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,17 @@ import {
66
ArrowRightIcon,
77
CheckIcon,
88
CircleAlertIcon,
9-
DatabaseIcon,
10-
InfinityIcon,
119
InfoIcon,
1210
MoreHorizontalIcon,
1311
PencilIcon,
14-
PlusIcon,
15-
ShieldCheckIcon,
1612
Trash2Icon,
17-
WalletIcon,
1813
} from "lucide-react";
1914
import Link from "next/link";
2015
import { useState } from "react";
2116
import { useForm } from "react-hook-form";
2217
import { toast } from "sonner";
2318
import { z } from "zod";
2419
import type { Team } from "@/api/team/get-team";
25-
import { CheckoutButton } from "@/components/billing/billing";
2620
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
2721
import { Badge, type BadgeProps } from "@/components/ui/badge";
2822
import { Button } from "@/components/ui/button";
@@ -31,20 +25,10 @@ import {
3125
Dialog,
3226
DialogContent,
3327
DialogDescription,
34-
DialogFooter,
3528
DialogHeader,
3629
DialogTitle,
37-
DialogTrigger,
3830
} from "@/components/ui/dialog";
39-
import {
40-
Drawer,
41-
DrawerContent,
42-
DrawerDescription,
43-
DrawerFooter,
44-
DrawerHeader,
45-
DrawerTitle,
46-
DrawerTrigger,
47-
} from "@/components/ui/drawer";
31+
4832
import {
4933
DropdownMenu,
5034
DropdownMenuContent,
@@ -72,7 +56,6 @@ import {
7256
TableRow,
7357
} from "@/components/ui/table";
7458
import { Textarea } from "@/components/ui/textarea";
75-
import { useIsMobile } from "@/hooks/use-mobile";
7659
import {
7760
type DeleteCloudHostedEngineParams,
7861
deleteCloudHostedEngine,
@@ -84,7 +67,6 @@ import {
8467
} from "@/hooks/useEngine";
8568
import { EngineIcon } from "@/icons/EngineIcon";
8669
import { useDashboardRouter } from "@/lib/DashboardRouter";
87-
import { cn } from "@/lib/utils";
8870

8971
type DeletedCloudHostedEngine = (
9072
params: DeleteCloudHostedEngineParams,
@@ -126,96 +108,6 @@ export function EngineInstancesTable(props: {
126108
);
127109
}
128110

129-
export function DedicatedEngineSubscriptionButton(props: { team: Team }) {
130-
const [open, setOpen] = useState(false);
131-
const isMobile = useIsMobile();
132-
133-
const trigger = (
134-
<Button className="gap-2 rounded-full" size="sm">
135-
<PlusIcon className="size-3.5" />
136-
Deploy Dedicated Engine
137-
</Button>
138-
);
139-
140-
const title = (
141-
<div className="flex flex-row items-center gap-2">
142-
<div className="grid size-8 place-items-center rounded-full bg-warning-text">
143-
<DatabaseIcon className="size-4 text-white" />
144-
</div>
145-
<span className="font-semibold text-lg">Dedicated Engine</span>
146-
</div>
147-
);
148-
149-
const content = (
150-
<div className="flex flex-col items-start justify-center gap-4 px-4 md:px-0">
151-
<ul className="flex flex-col gap-1 self-start text-muted-foreground text-sm">
152-
<li className="flex items-center gap-2">
153-
<ShieldCheckIcon className="size-4 text-foreground" />
154-
Isolated environment
155-
</li>
156-
<li className="flex items-center gap-2">
157-
<WalletIcon className="size-4 text-foreground" />
158-
EOA or Smart Wallets
159-
</li>
160-
<li className="flex items-center gap-2">
161-
<InfinityIcon className="size-4 text-foreground" />
162-
No transaction usage limits or charges
163-
</li>
164-
</ul>
165-
</div>
166-
);
167-
168-
if (isMobile) {
169-
return (
170-
<Drawer onOpenChange={setOpen} open={open}>
171-
<DrawerTrigger asChild>{trigger}</DrawerTrigger>
172-
<DrawerContent className="max-h-[90vh]">
173-
<DrawerHeader>
174-
<DrawerTitle>{title}</DrawerTitle>
175-
<DrawerDescription>
176-
Instantly deploy a dedicated engine instance for your team.
177-
</DrawerDescription>
178-
</DrawerHeader>
179-
{content}
180-
<DrawerFooter>
181-
<CheckoutButton
182-
billingStatus={props.team.billingStatus}
183-
sku="product:engine_standard"
184-
teamSlug={props.team.slug}
185-
>
186-
Deploy Now · $299 / month
187-
</CheckoutButton>
188-
</DrawerFooter>
189-
</DrawerContent>
190-
</Drawer>
191-
);
192-
}
193-
194-
return (
195-
<Dialog onOpenChange={setOpen} open={open}>
196-
<DialogTrigger asChild>{trigger}</DialogTrigger>
197-
<DialogContent>
198-
<DialogHeader>
199-
<DialogTitle>{title}</DialogTitle>
200-
<DialogDescription>
201-
Instantly deploy a dedicated engine instance for your team.
202-
</DialogDescription>
203-
</DialogHeader>
204-
{content}
205-
<DialogFooter>
206-
<CheckoutButton
207-
billingStatus={props.team.billingStatus}
208-
sku="product:engine_standard"
209-
teamSlug={props.team.slug}
210-
>
211-
Deploy Now · $299 / month
212-
</CheckoutButton>
213-
</DialogFooter>
214-
</DialogContent>
215-
</Dialog>
216-
);
217-
}
218-
219111
export function EngineInstancesTableUI(props: {
220112
instances: EngineInstance[];
221113
engineLinkPrefix: string;
@@ -896,10 +788,6 @@ function DeleteEngineSubscriptionModalContent(props: {
896788
}
897789

898790
function EmptyEngineState(props: { team: Team; projectSlug: string }) {
899-
const [selectedTab, setSelectedTab] = useState<
900-
"self-hosted" | "cloud-hosted"
901-
>("cloud-hosted");
902-
903791
return (
904792
<div className="flex flex-col items-center justify-center rounded-lg border bg-card px-4 py-12 lg:px-6">
905793
<div className="mb-4 rounded-full border bg-card p-2">
@@ -908,75 +796,34 @@ function EmptyEngineState(props: { team: Team; projectSlug: string }) {
908796

909797
<h2 className="mb-1 font-semibold text-xl">No Engine instances found</h2>
910798
<p className="mb-6 max-w-lg text-center text-muted-foreground text-sm">
911-
Get started with one of the options below to add your first engine
912-
instance.
799+
Import an Engine instance running on your own infrastructure.
913800
</p>
914801

915802
<div className="w-full max-w-md">
916-
<div className="mx-auto max-w-sm">
917-
<div className="grid grid-cols-2 gap-1 rounded-lg border p-1">
918-
<Button
919-
className={cn(selectedTab === "cloud-hosted" && "bg-accent")}
920-
onClick={() => setSelectedTab("cloud-hosted")}
921-
size="sm"
922-
variant="ghost"
923-
>
924-
Managed
925-
</Button>
803+
<div className="h-5" />
926804

805+
<div className="flex flex-col text-center">
806+
<h3 className="mb-0.5 font-semibold text-base">Self-Hosted Engine</h3>
807+
<p className="text-muted-foreground text-sm">
808+
Add engine instance running on your own infrastructure.
809+
</p>
810+
<div className="h-4" />
811+
<div className="mt-auto">
927812
<Button
928-
className={cn(selectedTab === "self-hosted" && "bg-accent")}
929-
onClick={() => setSelectedTab("self-hosted")}
813+
asChild
814+
className="w-full gap-2"
930815
size="sm"
931-
variant="ghost"
816+
variant="default"
932817
>
933-
Self-hosted
818+
<Link
819+
href={`/team/${props.team.slug}/${props.projectSlug}/engine`}
820+
>
821+
Import self-hosted Engine
822+
<ArrowRightIcon size={16} />
823+
</Link>
934824
</Button>
935825
</div>
936826
</div>
937-
938-
<div className="h-5" />
939-
940-
{selectedTab === "self-hosted" && (
941-
<div className="flex flex-col text-center">
942-
<h3 className="mb-0.5 font-semibold text-base">
943-
Self-Hosted Engine
944-
</h3>
945-
<p className="text-muted-foreground text-sm">
946-
Add engine instance running on your own infrastructure.
947-
</p>
948-
<div className="h-4" />
949-
<div className="mt-auto">
950-
<Button
951-
asChild
952-
className="w-full gap-2"
953-
size="sm"
954-
variant="default"
955-
>
956-
<Link
957-
href={`/team/${props.team.slug}/${props.projectSlug}/engine`}
958-
>
959-
Import self-hosted Engine
960-
<ArrowRightIcon size={16} />
961-
</Link>
962-
</Button>
963-
</div>
964-
</div>
965-
)}
966-
967-
{selectedTab === "cloud-hosted" && (
968-
<div className="flex flex-col text-center">
969-
<h3 className="mb-0.5 font-semibold text-base">Managed Engine</h3>
970-
<p className="text-muted-foreground text-sm">
971-
Deploy a managed engine instance to your team. <br /> We recommend
972-
using Engine Cloud in most cases.
973-
</p>
974-
<div className="h-4" />
975-
<div className="mt-auto">
976-
<DedicatedEngineSubscriptionButton team={props.team} />
977-
</div>
978-
</div>
979-
)}
980827
</div>
981828

982829
<div className="mt-4 text-center text-muted-foreground text-sm">

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/page.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
77
import { loginRedirect } from "@/utils/redirects";
88
import { getEngineInstances } from "../_utils/getEngineInstances";
99
import { ImportEngineButton } from "./import/import-engine-dialog";
10-
import { DedicatedEngineSubscriptionButton } from "./overview/engine-instances-table";
1110
import { EngineInstancesList } from "./overview/engine-list";
1211

1312
export default async function Page(props: {
@@ -61,9 +60,6 @@ export default async function Page(props: {
6160
title: "Engine",
6261
description: "Manage your deployed Engine instances.",
6362
actions: {
64-
primary: {
65-
component: <DedicatedEngineSubscriptionButton team={team} />,
66-
},
6763
secondary: {
6864
component: (
6965
<ImportEngineButton
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
TableHeader,
1414
TableRow,
1515
} from "@/components/ui/table";
16-
import { CardHeading } from "../../payments/components/common";
16+
import { CardHeading } from "../../../payments/components/common";
1717

1818
export function TopInsightChainsTable(props: {
1919
data: InsightChainStats[];

0 commit comments

Comments
 (0)