Skip to content

Commit c7fab9f

Browse files
committed
Dashboard: Migrate Published Contract page from chakra to tailwind, UI improvements (#7728)
<!-- ## 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 improving the UI components and structure of the published contract pages in the dashboard. It enhances layouts, updates component props, and modifies styles for better user experience and consistency. ### Detailed summary - Updated `version-selector` styles. - Modified `PublishedContractBreadcrumbs` to accept `className` prop. - Simplified `PublishedContractLayout` by returning only `props.children`. - Refactored `DeployFormForUri` to remove `ChakraProviderSetup`. - Enhanced `ExplorePage` layout and styles. - Changed icons in `PublishedActions` and updated button structure. - Improved `DeployContractInfo` layout and styles. - Updated `MarkdownRenderer` styles for better spacing and alignment. - Refactored `PublishedContract` to use `className` prop for styling. - Added `PublishedContractBreadcrumbs` to multiple pages for better navigation. - Improved `PublisherHeader` layout and styling. - Removed unused imports and cleaned up code. > ✨ 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 breadcrumb navigation to published contract and deploy pages for improved navigation clarity. * **Refactor** * Replaced Chakra UI components with Tailwind CSS for more consistent styling and layout across published contract pages. * Simplified and reorganized contract detail and publisher header layouts for better readability and usability. * Updated contract info display to use an enhanced image component with fallback support. * **Style** * Adjusted spacing, borders, and typography for headings, lists, and paragraphs in Markdown rendering. * Refined button and icon styles for contract actions and links. * Improved overall page structure and container consistency. * **Bug Fixes** * Enhanced fallback behavior for contract images when unavailable. * **Chores** * Removed unused sharing utility and related "Share" button from contract actions. * Cleaned up unused Chakra UI imports and wrappers. * **Documentation** * No user-facing documentation changes included. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 882ed83 commit c7fab9f

File tree

15 files changed

+371
-362
lines changed

15 files changed

+371
-362
lines changed

apps/dashboard/src/@/components/blocks/markdown-renderer.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const MarkdownRenderer: React.FC<{
9494
<h2
9595
className={cn(
9696
commonHeadingClassName,
97-
"mb-3 border-border border-b pb-2 text-xl md:text-2xl",
97+
"mb-3 border-dashed border-b pb-2 text-xl md:text-2xl",
9898
)}
9999
{...cleanedProps(props)}
100100
/>
@@ -105,7 +105,7 @@ export const MarkdownRenderer: React.FC<{
105105
{...cleanedProps(props)}
106106
className={cn(
107107
commonHeadingClassName,
108-
"mt-8 mb-3 border-border border-b pb-2 text-lg md:text-xl",
108+
"mt-8 mb-3 border-dashed border-b pb-2 text-lg md:text-xl",
109109
)}
110110
/>
111111
),
@@ -147,7 +147,7 @@ export const MarkdownRenderer: React.FC<{
147147
li: ({ children: c, ...props }) => (
148148
<li
149149
className={cn(
150-
"mb-1.5 text-muted-foreground leading-loose [&>p]:m-0",
150+
"text-muted-foreground leading-relaxed [&>p]:m-0",
151151
markdownProps.li?.className,
152152
)}
153153
{...cleanedProps(props)}
@@ -157,15 +157,15 @@ export const MarkdownRenderer: React.FC<{
157157
),
158158
ol: (props) => (
159159
<ol
160-
className="mb-4 list-outside list-decimal pl-5 [&_ol_li:first-of-type]:mt-1.5 [&_ul_li:first-of-type]:mt-1.5"
160+
className="mb-4 list-outside list-decimal pl-4 space-y-2 [&>li]:first:mt-2"
161161
{...cleanedProps(props)}
162162
/>
163163
),
164164

165165
p: (props) => (
166166
<p
167167
className={cn(
168-
"mb-4 text-muted-foreground leading-loose",
168+
"mb-3 text-muted-foreground leading-7",
169169
markdownProps.p?.className,
170170
)}
171171
{...cleanedProps(props)}
@@ -201,7 +201,7 @@ export const MarkdownRenderer: React.FC<{
201201
ul: (props) => {
202202
return (
203203
<ul
204-
className="mb-4 list-outside list-disc pl-5 [&_ol_li:first-of-type]:mt-1.5 [&_ul_li:first-of-type]:mt-1.5"
204+
className="mb-4 list-outside list-disc pl-4 space-y-2 [&>li]:first:mt-2"
205205
{...cleanedProps(props)}
206206
/>
207207
);
Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import { ExternalLinkIcon } from "lucide-react";
34
import Link from "next/link";
45
import { type ThirdwebClient, ZERO_ADDRESS } from "thirdweb";
56
import {
@@ -9,7 +10,6 @@ import {
910
AccountName,
1011
AccountProvider,
1112
} from "thirdweb/react";
12-
import { Button } from "@/components/ui/button";
1313
import { Skeleton } from "@/components/ui/skeleton";
1414
import { useEns } from "@/hooks/contract-hooks";
1515
import { replaceDeployerAddress } from "@/lib/publisher-utils";
@@ -29,57 +29,63 @@ export const PublisherHeader: React.FC<PublisherHeaderProps> = ({
2929
});
3030

3131
return (
32-
<div className="flex w-full flex-col gap-4">
33-
<h4 className="font-semibold text-lg tracking-tight">Published by</h4>
34-
32+
<div>
33+
<h4 className="font-medium text-base mb-3">Published by</h4>
3534
<AccountProvider
3635
// passing zero address during loading time to prevent the component from crashing
3736
address={ensQuery.data?.address || ZERO_ADDRESS}
3837
client={client}
3938
>
40-
<div className="relative flex items-center gap-3">
41-
<AccountAvatar
42-
className="size-10 rounded-full border border-border border-solid object-cover"
43-
fallbackComponent={
44-
<AccountBlobbie className="size-10 rounded-full" />
45-
}
46-
loadingComponent={<Skeleton className="size-10 rounded-full" />}
47-
/>
48-
49-
<Link
50-
className="before:absolute before:inset-0 hover:underline"
51-
href={replaceDeployerAddress(
52-
`/${ensQuery.data?.ensName || wallet}`,
53-
)}
54-
rel="noopener noreferrer"
55-
target="_blank"
56-
>
57-
<AccountName
58-
className="font-medium"
39+
<div className="flex items-center gap-3 relative">
40+
<div className="translate-y-0.5">
41+
<AccountAvatar
42+
className="size-[34px] rounded-full border border-border border-solid object-cover"
5943
fallbackComponent={
60-
// When social profile API support other TLDs as well - we can remove this condition
61-
ensQuery.data?.ensName ? (
62-
<span> {ensQuery.data?.ensName} </span>
63-
) : (
64-
<AccountAddress
65-
formatFn={(addr) =>
66-
shortenIfAddress(replaceDeployerAddress(addr))
67-
}
68-
/>
69-
)
44+
<AccountBlobbie className="size-[34px] rounded-full" />
45+
}
46+
loadingComponent={
47+
<Skeleton className="size-[34px] rounded-full" />
7048
}
71-
formatFn={(name) => replaceDeployerAddress(name)}
72-
loadingComponent={<Skeleton className="h-8 w-40" />}
7349
/>
74-
</Link>
50+
</div>
51+
52+
<div className="space-y-1">
53+
<Link
54+
className="hover:underline leading-none before:absolute before:inset-0"
55+
href={replaceDeployerAddress(
56+
`/${ensQuery.data?.ensName || wallet}`,
57+
)}
58+
rel="noopener noreferrer"
59+
target="_blank"
60+
>
61+
<AccountName
62+
className="text-base leading-none font-medium"
63+
fallbackComponent={
64+
// When social profile API support other TLDs as well - we can remove this condition
65+
ensQuery.data?.ensName ? (
66+
<span className="text-base leading-none font-medium">
67+
{ensQuery.data?.ensName}
68+
</span>
69+
) : (
70+
<AccountAddress
71+
formatFn={(addr) =>
72+
shortenIfAddress(replaceDeployerAddress(addr))
73+
}
74+
/>
75+
)
76+
}
77+
formatFn={(name) => replaceDeployerAddress(name)}
78+
loadingComponent={<Skeleton className="h-6 w-40" />}
79+
/>
80+
</Link>
81+
82+
<span className="text-sm text-muted-foreground flex items-center gap-1.5 leading-none">
83+
View all published contracts{" "}
84+
<ExternalLinkIcon className="size-3 text-muted-foreground" />
85+
</span>
86+
</div>
7587
</div>
7688
</AccountProvider>
77-
78-
<Button asChild className="bg-card" variant="outline">
79-
<Link href={replaceDeployerAddress(`/${wallet}`)}>
80-
View all contracts
81-
</Link>
82-
</Button>
8389
</div>
8490
);
8591
};

0 commit comments

Comments
 (0)