Skip to content

Commit 4bab6f1

Browse files
committed
[PRO-125] Dashboard: Update token creation modal UI (#8561)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing the UI components in the dashboard by improving dialog descriptions, layout adjustments, and introducing images for token cards, along with some styling updates. ### Detailed summary - Added `DialogDescription` to provide context in the dialog. - Increased `DialogContent` max width from `!max-w-md` to `!max-w-2xl`. - Changed layout of `Cards` from a column to a grid. - Introduced `images` for token cards with light and dark themes. - Updated descriptions for token creation. - Enhanced styling of `CardLink` components, including rounded corners. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added theme-aware image rendering with light and dark mode support for card components. * Implemented responsive 2-column grid layout on larger screens. * **Style** * Increased border radius on cards and dialog components for a more refined appearance. * Enhanced card title typography sizing. * Expanded dialog width for improved content display. * Improved responsive behavior with compact icons on smaller viewports. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent f9a4350 commit 4bab6f1

File tree

7 files changed

+42
-13
lines changed

7 files changed

+42
-13
lines changed
50.3 KB
Loading
42 KB
Loading
16.3 KB
Loading
17.1 KB
Loading

apps/dashboard/src/@/components/ui/dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const DialogContent = React.forwardRef<
4242
<DialogOverlay className={dialogOverlayClassName} />
4343
<DialogPrimitive.Content
4444
className={cn(
45-
"fixed z-50 grid w-full gap-4 rounded-t-xl border border-border bg-background p-6 shadow-lg duration-300 md:max-w-lg md:rounded-lg",
45+
"fixed z-50 grid w-full gap-4 rounded-t-xl border border-border bg-background p-6 shadow-lg duration-300 md:max-w-lg md:rounded-xl",
4646
// on mobile - put the dialog at the bottom of the screen, animate - slide up and fade in
4747
"right-0 bottom-0 left-0",
4848
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/cards.tsx renamed to apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/tokens/(general)/cards.tsx

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

33
import { Button } from "@workspace/ui/components/button";
4+
import { Img } from "@workspace/ui/components/img";
45
import { ArrowDownToLineIcon, CoinsIcon, ImagesIcon } from "lucide-react";
56
import Link from "next/link";
7+
import { useTheme } from "next-themes";
68
import { useState } from "react";
79
import type { ThirdwebClient } from "thirdweb";
810
import {
@@ -63,19 +65,27 @@ export function Cards(props: {
6365
projectId: string;
6466
}) {
6567
return (
66-
<div className="flex flex-col gap-4">
68+
<div className="grid lg:grid-cols-2 gap-4">
6769
<CardLink
68-
description="Launch your own ERC-20 coin"
70+
images={{
71+
light: "/assets/tokens/coin-light.png",
72+
dark: "/assets/tokens/coin-dark.png",
73+
}}
74+
description="Launch an ERC-20 coin with various pricing strategies"
6975
href={`/team/${props.teamSlug}/${props.projectSlug}/tokens/create/token`}
7076
icon={CoinsIcon}
71-
title="Create Coin"
77+
title="Coin"
7278
/>
7379

7480
<CardLink
75-
description="Launch your own NFT collection"
81+
images={{
82+
light: "/assets/tokens/nft-light.png",
83+
dark: "/assets/tokens/nft-dark.png",
84+
}}
85+
description="Launch an ERC-721 or ERC-1155 NFT collection"
7686
href={`/team/${props.teamSlug}/${props.projectSlug}/tokens/create/nft`}
7787
icon={ImagesIcon}
78-
title="Create NFT Collection"
88+
title="NFT Collection"
7989
/>
8090
</div>
8191
);
@@ -87,15 +97,20 @@ function CardLink(props: {
8797
href: string | undefined;
8898
onClick?: () => void;
8999
icon: React.FC<{ className?: string }>;
100+
images: {
101+
dark: string;
102+
light: string;
103+
};
90104
}) {
91105
const { onClick } = props;
92106
const isClickable = !!onClick || !!props.href;
107+
const { resolvedTheme } = useTheme();
93108

94109
return (
95110
// biome-ignore lint/a11y/noStaticElementInteractions: FIXME
96111
<div
97112
className={cn(
98-
"relative flex flex-col rounded-lg border bg-card p-4",
113+
"relative flex flex-col rounded-xl border bg-card p-4",
99114
isClickable && "cursor-pointer hover:border-active-border ",
100115
)}
101116
onClick={onClick}
@@ -107,13 +122,23 @@ function CardLink(props: {
107122
role={onClick ? "button" : undefined}
108123
tabIndex={onClick ? 0 : undefined}
109124
>
110-
<div className="mb-4 flex">
111-
<div className="flex items-center justify-center rounded-full border p-2">
112-
<props.icon className="size-4 text-muted-foreground" />
125+
<div className="mb-4">
126+
<div className="flex lg:hidden">
127+
<div className="flex items-center justify-center rounded-full border p-2">
128+
<props.icon className="size-4 text-muted-foreground" />
129+
</div>
113130
</div>
131+
132+
<Img
133+
src={
134+
resolvedTheme === "light" ? props.images.light : props.images.dark
135+
}
136+
alt={props.title}
137+
className="hidden lg:block"
138+
/>
114139
</div>
115140

116-
<h3 className="mb-0.5 font-semibold text-lg tracking-tight">
141+
<h3 className="mb-0.5 font-semibold text-xl tracking-tight">
117142
{props.href ? (
118143
<Link className="before:absolute before:inset-0" href={props.href}>
119144
{props.title}

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ import { ProjectPage } from "@/components/blocks/project-page/project-page";
88
import {
99
Dialog,
1010
DialogContent,
11+
DialogDescription,
1112
DialogHeader,
1213
DialogTitle,
1314
DialogTrigger,
1415
} from "@/components/ui/dialog";
1516
import { getClientThirdwebClient } from "@/constants/thirdweb-client.client";
1617
import { TokenIcon } from "@/icons/TokenIcon";
1718
import { loginRedirect } from "@/utils/redirects";
18-
import { Cards, ImportTokenButton } from "../cards";
19+
import { Cards, ImportTokenButton } from "./cards";
1920

2021
export default async function Layout(props: {
2122
params: Promise<{ team_slug: string; project_slug: string }>;
@@ -63,9 +64,12 @@ export default async function Layout(props: {
6364
Create Token
6465
</Button>
6566
</DialogTrigger>
66-
<DialogContent className="!max-w-md">
67+
<DialogContent className="!max-w-2xl">
6768
<DialogHeader>
6869
<DialogTitle>Create Token</DialogTitle>
70+
<DialogDescription>
71+
Launch your own ERC-20 coin or NFT collection
72+
</DialogDescription>
6973
</DialogHeader>
7074
<Cards
7175
client={client}

0 commit comments

Comments
 (0)