-
Notifications
You must be signed in to change notification settings - Fork 619
[Dashboard] Feature: Add initial insight UI #5435
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
...shboard/src/app/team/[team_slug]/[project_slug]/insight/components/BlueprintsExplorer.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| "use client"; | ||
|
|
||
| import {} from "@/components/ui/dropdown-menu"; | ||
| import {} from "@/components/ui/select"; | ||
| import { Layers3 } from "lucide-react"; | ||
| import Link from "next/link"; | ||
|
|
||
| export type Blueprint = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| description: string; | ||
| }; | ||
|
|
||
| export function BlueprintsExplorer(props: { | ||
| blueprints: Blueprint[]; | ||
| }) { | ||
| const { blueprints } = props; | ||
| return ( | ||
| <div className="container"> | ||
| {/* Blueprints */} | ||
| {blueprints.length === 0 ? ( | ||
| <div className="flex h-[450px] items-center justify-center rounded-lg border border-border "> | ||
| No blueprints found | ||
| </div> | ||
| ) : ( | ||
| <div className="grid grid-cols-1 gap-5 md:grid-cols-2 lg:grid-cols-3"> | ||
| {blueprints.map((blueprint) => { | ||
| return <BlueprintCard key={blueprint.id} blueprint={blueprint} />; | ||
| })} | ||
| </div> | ||
| )} | ||
|
|
||
| <div className="h-10" /> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| function BlueprintCard(props: { | ||
| blueprint: Blueprint; | ||
| }) { | ||
| const { blueprint } = props; | ||
| return ( | ||
| <div | ||
| key={blueprint.id} | ||
| className="relative flex items-center gap-4 rounded-lg border border-border bg-muted/50 p-4 transition-colors hover:bg-muted/70" | ||
| > | ||
| <Layers3 className="size-10" /> | ||
|
|
||
| <div> | ||
| <Link | ||
| className="group static before:absolute before:top-0 before:right-0 before:bottom-0 before:left-0 before:z-0" | ||
| href={`https://portal.thirdweb.com/insight/blueprints#${blueprint.slug}`} | ||
| > | ||
| <h2 className="font-medium text-base">{blueprint.name}</h2> | ||
| </Link> | ||
|
|
||
| <p className="my-1 text-muted-foreground/70 text-xs"> | ||
| {blueprint.description} | ||
| </p> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
41 changes: 41 additions & 0 deletions
41
apps/dashboard/src/app/team/[team_slug]/[project_slug]/insight/components/BlueprintsPage.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { type Blueprint, BlueprintsExplorer } from "./BlueprintsExplorer"; | ||
| import { BlueprintsPageHeader } from "./BlueprintsPageHeader"; | ||
|
|
||
| export function BlueprintsPage() { | ||
| return ( | ||
| <div> | ||
| <BlueprintsPageHeader /> | ||
| <div className="h-6" /> | ||
| <BlueprintsPageContent /> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| function getProjectBlueprints() { | ||
| return [ | ||
| { | ||
| id: "1", | ||
| name: "Transactions", | ||
| slug: "transactions-blueprint", | ||
| description: "Query transaction data", | ||
| }, | ||
| { | ||
| id: "2", | ||
| name: "Events", | ||
| slug: "events-blueprint", | ||
| description: "Query event data", | ||
| }, | ||
| { | ||
| id: "3", | ||
| name: "Tokens", | ||
| slug: "tokens-blueprint", | ||
| description: "Query ERC-20, ERC-721, and ERC-1155 tokens", | ||
| }, | ||
| ] as Blueprint[]; | ||
| } | ||
|
|
||
| function BlueprintsPageContent() { | ||
| const blueprints = getProjectBlueprints(); | ||
|
|
||
| return <BlueprintsExplorer blueprints={blueprints} />; | ||
| } |
25 changes: 25 additions & 0 deletions
25
...board/src/app/team/[team_slug]/[project_slug]/insight/components/BlueprintsPageHeader.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| "use client"; | ||
|
|
||
| import { Button } from "@/components/ui/button"; | ||
| import { PlusIcon } from "lucide-react"; | ||
|
|
||
| export function BlueprintsPageHeader() { | ||
| return ( | ||
| <div className="flex grow flex-col"> | ||
| <div className="border-border border-b py-10"> | ||
| <div className="container flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"> | ||
| <h1 className="font-semibold text-2xl tracking-tight sm:text-3xl"> | ||
| Insight | ||
| </h1> | ||
| <Button | ||
| className="w-full cursor-not-allowed gap-2 opacity-50 sm:w-auto" | ||
| disabled | ||
| > | ||
| <PlusIcon className="size-4" /> | ||
| Create Blueprint (Coming Soon) | ||
| </Button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
AmineAfia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
18 changes: 18 additions & 0 deletions
18
apps/dashboard/src/app/team/[team_slug]/[project_slug]/insight/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { redirect } from "next/navigation"; | ||
| import { getAuthTokenWalletAddress } from "../../../../api/lib/getAuthToken"; | ||
| import { BlueprintsPage } from "./components/BlueprintsPage"; | ||
|
|
||
| export default async function Page(props: { | ||
| params: Promise<{ team_slug: string; project_slug: string }>; | ||
| }) { | ||
| const accountAddress = await getAuthTokenWalletAddress(); | ||
|
|
||
| if (!accountAddress) { | ||
| const { team_slug, project_slug } = await props.params; | ||
| return redirect( | ||
| `/login?next=${encodeURIComponent(`/team/${team_slug}/${project_slug}/insight`)}`, | ||
| ); | ||
| } | ||
|
|
||
| return <BlueprintsPage />; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.