Skip to content

Commit 51eda91

Browse files
committed
[TOOL-4621] New ERC20 public contract page
1 parent 16482cf commit 51eda91

File tree

63 files changed

+2307
-146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2307
-146
lines changed

apps/dashboard/src/@/actions/getWalletNFTs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { WalletNFT } from "lib/wallet/nfts/types";
1212
import { getVercelEnv } from "../../lib/vercel-utils";
1313
import { isAlchemySupported } from "../../lib/wallet/nfts/isAlchemySupported";
1414
import { isMoralisSupported } from "../../lib/wallet/nfts/isMoralisSupported";
15-
import { NET_PUBLIC_DASHBOARD_THIRDWEB_CLIENT_ID } from "../constants/public-envs";
15+
import { NEXT_PUBLIC_DASHBOARD_CLIENT_ID } from "../constants/public-envs";
1616
import { MORALIS_API_KEY } from "../constants/server-envs";
1717

1818
type WalletNFTApiReturn =
@@ -149,7 +149,7 @@ async function getWalletNFTsFromInsight(params: {
149149

150150
const response = await fetch(url, {
151151
headers: {
152-
"x-client-id": NET_PUBLIC_DASHBOARD_THIRDWEB_CLIENT_ID,
152+
"x-client-id": NEXT_PUBLIC_DASHBOARD_CLIENT_ID,
153153
},
154154
});
155155

apps/dashboard/src/@/components/blocks/UpsellBannerCard.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ type UpsellBannerCardProps = {
4141
cta: {
4242
text: React.ReactNode;
4343
icon?: React.ReactNode;
44+
target?: "_blank";
4445
link: string;
4546
};
4647
trackingCategory: string;
@@ -55,7 +56,7 @@ export function UpsellBannerCard(props: UpsellBannerCardProps) {
5556
return (
5657
<div
5758
className={cn(
58-
"relative overflow-hidden rounded-lg border bg-gradient-to-r p-5",
59+
"relative overflow-hidden rounded-lg border bg-gradient-to-r p-4 lg:p-6",
5960
color.border,
6061
color.bgFrom,
6162
)}
@@ -73,7 +74,7 @@ export function UpsellBannerCard(props: UpsellBannerCardProps) {
7374
{props.icon ? (
7475
<div
7576
className={cn(
76-
"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-full",
77+
"mt-0.5 hidden h-9 w-9 shrink-0 items-center justify-center rounded-full lg:flex",
7778
color.iconBg,
7879
)}
7980
>
@@ -90,9 +91,7 @@ export function UpsellBannerCard(props: UpsellBannerCardProps) {
9091
>
9192
{props.title}
9293
</h3>
93-
<p className={cn("mt-0.5 text-sm", color.desc)}>
94-
{props.description}
95-
</p>
94+
<p className={cn("text-sm", color.desc)}>{props.description}</p>
9695
</div>
9796
</div>
9897

@@ -108,6 +107,7 @@ export function UpsellBannerCard(props: UpsellBannerCardProps) {
108107
href={props.cta.link}
109108
category={props.trackingCategory}
110109
label={props.trackingLabel}
110+
target={props.cta.target}
111111
>
112112
{props.cta.text}
113113
{props.cta.icon && <span className="ml-2">{props.cta.icon}</span>}

apps/dashboard/src/@/components/blocks/charts/area-chart.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ type ThirdwebAreaChartProps<TConfig extends ChartConfig> = {
4646
// chart className
4747
chartClassName?: string;
4848
isPending: boolean;
49+
className?: string;
50+
cardContentClassName?: string;
4951
hideLabel?: boolean;
5052
toolTipLabelFormatter?: (label: string, payload: unknown) => React.ReactNode;
53+
toolTipValueFormatter?: (value: unknown) => React.ReactNode;
54+
emptyChartState?: React.ReactElement;
5155
};
5256

5357
export function ThirdwebAreaChart<TConfig extends ChartConfig>(
@@ -56,7 +60,7 @@ export function ThirdwebAreaChart<TConfig extends ChartConfig>(
5660
const configKeys = useMemo(() => Object.keys(props.config), [props.config]);
5761

5862
return (
59-
<Card>
63+
<Card className={props.className}>
6064
{props.header && (
6165
<CardHeader>
6266
<CardTitle className={cn("mb-2", props.header.titleClassName)}>
@@ -70,12 +74,16 @@ export function ThirdwebAreaChart<TConfig extends ChartConfig>(
7074

7175
{props.customHeader && props.customHeader}
7276

73-
<CardContent className={cn(!props.header && "pt-6")}>
77+
<CardContent
78+
className={cn(!props.header && "pt-6", props.cardContentClassName)}
79+
>
7480
<ChartContainer config={props.config} className={props.chartClassName}>
7581
{props.isPending ? (
7682
<LoadingChartState />
7783
) : props.data.length === 0 ? (
78-
<EmptyChartState />
84+
<EmptyChartState type="area">
85+
{props.emptyChartState}
86+
</EmptyChartState>
7987
) : (
8088
<AreaChart accessibilityLayer data={props.data}>
8189
<CartesianGrid vertical={false} />
@@ -100,6 +108,7 @@ export function ThirdwebAreaChart<TConfig extends ChartConfig>(
100108
props.hideLabel !== undefined ? props.hideLabel : true
101109
}
102110
labelFormatter={props.toolTipLabelFormatter}
111+
valueFormatter={props.toolTipValueFormatter}
103112
/>
104113
}
105114
/>

apps/dashboard/src/@/components/blocks/charts/bar-chart.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ export function ThirdwebBarChart<TConfig extends ChartConfig>(
7575
{props.isPending ? (
7676
<LoadingChartState />
7777
) : props.data.length === 0 ? (
78-
<EmptyChartState>{props.emptyChartState}</EmptyChartState>
78+
<EmptyChartState type="bar">
79+
{props.emptyChartState}
80+
</EmptyChartState>
7981
) : (
8082
<BarChart accessibilityLayer data={props.data}>
8183
<CartesianGrid vertical={false} />
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export function LoadingDots() {
2+
return (
3+
<div className="fade-in-0 flex animate-in gap-2 duration-300">
4+
<span className="sr-only">Loading...</span>
5+
<div className="size-4 animate-bounce rounded-full bg-foreground [animation-delay:-0.3s]" />
6+
<div className="size-4 animate-bounce rounded-full bg-foreground [animation-delay:-0.15s]" />
7+
<div className="size-4 animate-bounce rounded-full bg-foreground" />
8+
</div>
9+
);
10+
}

apps/dashboard/src/@/constants/public-envs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const NET_PUBLIC_DASHBOARD_THIRDWEB_CLIENT_ID =
1+
export const NEXT_PUBLIC_DASHBOARD_CLIENT_ID =
22
process.env.NEXT_PUBLIC_DASHBOARD_CLIENT_ID || "";
33

44
export const NEXT_PUBLIC_NEBULA_APP_CLIENT_ID =

apps/dashboard/src/@/constants/thirdweb.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {
2-
NET_PUBLIC_DASHBOARD_THIRDWEB_CLIENT_ID,
2+
NEXT_PUBLIC_DASHBOARD_CLIENT_ID,
33
NEXT_PUBLIC_IPFS_GATEWAY_URL,
44
} from "@/constants/public-envs";
55
import {
@@ -76,7 +76,7 @@ export function getConfiguredThirdwebClient(options: {
7676
return createThirdwebClient({
7777
teamId: options.teamId,
7878
secretKey: options.secretKey,
79-
clientId: NET_PUBLIC_DASHBOARD_THIRDWEB_CLIENT_ID,
79+
clientId: NEXT_PUBLIC_DASHBOARD_CLIENT_ID,
8080
config: {
8181
storage: {
8282
gatewayUrl: NEXT_PUBLIC_IPFS_GATEWAY_URL,
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { TeamHeader } from "../../team/components/TeamHeader/team-header";
2+
3+
export default function Layout({
4+
children,
5+
}: {
6+
children: React.ReactNode;
7+
}) {
8+
return (
9+
<div className="flex grow flex-col">
10+
<div className="border-border border-b bg-card">
11+
<TeamHeader />
12+
</div>
13+
{children}
14+
</div>
15+
);
16+
}

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client/live-stats.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CopyTextButton } from "@/components/ui/CopyTextButton";
44
import { Skeleton } from "@/components/ui/skeleton";
55
import { ToolTipLabel } from "@/components/ui/tooltip";
66
import { isProd } from "@/constants/env-utils";
7-
import { NET_PUBLIC_DASHBOARD_THIRDWEB_CLIENT_ID } from "@/constants/public-envs";
7+
import { NEXT_PUBLIC_DASHBOARD_CLIENT_ID } from "@/constants/public-envs";
88
import { useQuery } from "@tanstack/react-query";
99
import { CircleCheckIcon, XIcon } from "lucide-react";
1010
import { hostnameEndsWith } from "utils/url";
@@ -14,7 +14,7 @@ function useChainStatswithRPC(_rpcUrl: string) {
1414
let rpcUrl = _rpcUrl.replace(
1515
// eslint-disable-next-line no-template-curly-in-string
1616
"${THIRDWEB_API_KEY}",
17-
NET_PUBLIC_DASHBOARD_THIRDWEB_CLIENT_ID,
17+
NEXT_PUBLIC_DASHBOARD_CLIENT_ID,
1818
);
1919

2020
// based on the environment hit dev or production

apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
getAuthToken,
2525
getAuthTokenWalletAddress,
2626
} from "../../../../api/lib/getAuthToken";
27+
import { TeamHeader } from "../../../../team/components/TeamHeader/team-header";
2728
import { StarButton } from "../../components/client/star-button";
2829
import { getChain, getChainMetadata } from "../../utils";
2930
import { AddChainToWallet } from "./components/client/add-chain-to-wallet";
@@ -95,7 +96,10 @@ The following is the user's message:
9596
}
9697

9798
return (
98-
<>
99+
<div className="flex grow flex-col">
100+
<div className="border-border border-b bg-card">
101+
<TeamHeader />
102+
</div>
99103
<NebulaChatButton
100104
isLoggedIn={!!authToken}
101105
networks={chain.testnet ? "testnet" : "mainnet"}
@@ -225,7 +229,7 @@ The following is the user's message:
225229
{children}
226230
</div>
227231
</div>
228-
</>
232+
</div>
229233
);
230234
}
231235

0 commit comments

Comments
 (0)