Skip to content

Commit 0a9d58a

Browse files
authored
Merge branch 'main' into yash/ref-constructor-params
2 parents 842c4d9 + 3268af6 commit 0a9d58a

File tree

50 files changed

+1065
-444
lines changed

Some content is hidden

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

50 files changed

+1065
-444
lines changed

.changeset/curly-cycles-hammer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
More helpful error messages for enclave and userop errors

.changeset/dirty-goats-invent.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Fix connecting to cb wallet browser extension when already on the same chain

.changeset/serious-bananas-boil.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"thirdweb": minor
3+
---
4+
5+
Improve NFT Components
6+
- Add custom resolver methods to NFTMedia, NFTName and NFTDescription
7+
- Add caching for the NFT-info-getter method to improve performance
8+
- Small fix to handle falsy values for NFT media src, name and description
9+
- Improve test coverage by extracting internal logics and testing them

apps/dashboard/src/@3rdweb-sdk/react/components/connect-wallet/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export const CustomConnectWallet = (props: {
150150
<Link
151151
href={`/login${pathname ? `?next=${encodeURIComponent(pathname)}` : ""}`}
152152
>
153-
Sign In
153+
Connect Wallet
154154
</Link>
155155
</Button>
156156
</>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export function FaucetButton({
146146
<Link
147147
href={`/login${pathname ? `?next=${encodeURIComponent(pathname)}` : ""}`}
148148
>
149-
Sign In
149+
Connect Wallet
150150
</Link>
151151
</Button>
152152
);
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Card, Text } from "tw-components";
1+
import { Card } from "@/components/ui/card";
22

33
interface NftPropertyProps {
44
// biome-ignore lint/suspicious/noExplicitAny: FIXME
@@ -7,22 +7,17 @@ interface NftPropertyProps {
77

88
export const NftProperty: React.FC<NftPropertyProps> = ({ property }) => {
99
return (
10-
<Card className="flex flex-col gap-2">
10+
<Card className="flex flex-col gap-2 p-3">
1111
{property?.trait_type && (
12-
<Text
13-
size="label.sm"
14-
color="primary.500"
15-
textAlign="center"
16-
lineHeight={1.2}
17-
>
12+
<p className="text-center text-link-foreground text-sm leading-[1.2]">
1813
{property?.trait_type}
19-
</Text>
14+
</p>
2015
)}
21-
<Text size="label.md" textAlign="center">
16+
<p className="text-center text-muted-foreground text-sm">
2217
{typeof property?.value === "object"
2318
? JSON.stringify(property?.value || {})
2419
: property?.value}
25-
</Text>
20+
</p>
2621
</Card>
2722
);
2823
};
Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"use client";
2-
3-
import { Skeleton, Stat, StatLabel, StatNumber } from "@chakra-ui/react";
42
import { useMemo } from "react";
53
import type { ThirdwebContract } from "thirdweb";
64
import {
@@ -9,7 +7,7 @@ import {
97
totalSupply,
108
} from "thirdweb/extensions/erc721";
119
import { useReadContract } from "thirdweb/react";
12-
import { Card } from "tw-components";
10+
import { StatCard } from "../../overview/components/stat-card";
1311

1412
interface SupplyCardsProps {
1513
contract: ThirdwebContract;
@@ -37,27 +35,22 @@ export const SupplyCards: React.FC<SupplyCardsProps> = ({ contract }) => {
3735
);
3836

3937
return (
40-
<div className="flex flex-col gap-3 md:flex-row md:gap-6">
41-
<Card as={Stat}>
42-
<StatLabel mb={{ base: 1, md: 0 }}>Total Supply</StatLabel>
43-
<Skeleton isLoaded={nextTokenIdQuery.isSuccess}>
44-
<StatNumber>{realTotalSupply.toString()}</StatNumber>
45-
</Skeleton>
46-
</Card>
47-
<Card as={Stat}>
48-
<StatLabel mb={{ base: 1, md: 0 }}>Claimed Supply</StatLabel>
49-
<Skeleton isLoaded={totalSupplyQuery.isSuccess}>
50-
<StatNumber>{totalSupplyQuery?.data?.toString()}</StatNumber>
51-
</Skeleton>
52-
</Card>
53-
<Card as={Stat}>
54-
<StatLabel mb={{ base: 1, md: 0 }}>Unclaimed Supply</StatLabel>
55-
<Skeleton
56-
isLoaded={totalSupplyQuery.isSuccess && nextTokenIdQuery.isSuccess}
57-
>
58-
<StatNumber>{unclaimedSupply}</StatNumber>
59-
</Skeleton>
60-
</Card>
38+
<div className="flex flex-row gap-3 md:gap-6 [&>*]:grow">
39+
<StatCard
40+
value={realTotalSupply.toString()}
41+
label="Total Supply"
42+
isPending={nextTokenIdQuery.isPending}
43+
/>
44+
<StatCard
45+
value={totalSupplyQuery?.data?.toString() || "N/A"}
46+
label="Claimed Supply"
47+
isPending={totalSupplyQuery.isPending}
48+
/>
49+
<StatCard
50+
value={unclaimedSupply}
51+
label="Unclaimed Supply"
52+
isPending={totalSupplyQuery.isPending || nextTokenIdQuery.isPending}
53+
/>
6154
</div>
6255
);
6356
};

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/components/table.tsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import type { NFT, ThirdwebContract } from "thirdweb";
4141
import * as ERC721Ext from "thirdweb/extensions/erc721";
4242
import * as ERC1155Ext from "thirdweb/extensions/erc1155";
4343
import { useReadContract } from "thirdweb/react";
44-
import { Heading, Text } from "tw-components";
4544

4645
interface ContractOverviewNFTGetAllProps {
4746
contract: ThirdwebContract;
@@ -61,11 +60,7 @@ export const NFTGetAllTable: React.FC<ContractOverviewNFTGetAllProps> = ({
6160
{
6261
Header: "Token Id",
6362
accessor: (row) => row.id?.toString(),
64-
Cell: (cell: CellProps<NFT, string>) => (
65-
<Text size="body.md" fontFamily="mono">
66-
{cell.value}
67-
</Text>
68-
),
63+
Cell: (cell: CellProps<NFT, string>) => <p>{cell.value}</p>,
6964
},
7065
{
7166
Header: "Media",
@@ -140,9 +135,9 @@ export const NFTGetAllTable: React.FC<ContractOverviewNFTGetAllProps> = ({
140135
Cell: (cell: CellProps<NFT, number>) => {
141136
if (cell.row.original.type === "ERC1155") {
142137
return (
143-
<Text noOfLines={4} size="body.md" fontFamily="mono">
138+
<p className="line-clamp-4 font-mono text-base">
144139
{cell.row.original.supply.toString()}
145-
</Text>
140+
</p>
146141
);
147142
}
148143
},
@@ -267,9 +262,9 @@ export const NFTGetAllTable: React.FC<ContractOverviewNFTGetAllProps> = ({
267262
// biome-ignore lint/suspicious/noArrayIndexKey: FIXME
268263
key={columnIndex}
269264
>
270-
<Text as="label" size="label.sm" color="faded">
265+
<p className="text-muted-foreground">
271266
{column.render("Header")}
272-
</Text>
267+
</p>
273268
</Th>
274269
))}
275270
{/* Need to add an empty header for the drawer button */}
@@ -352,7 +347,7 @@ export const NFTGetAllTable: React.FC<ContractOverviewNFTGetAllProps> = ({
352347
>
353348
<Flex align="center" gap={4}>
354349
<Spinner size="sm" />
355-
<Heading size="label.lg">Fetching new page</Heading>
350+
<p className="text-lg">Fetching new page</p>
356351
</Flex>
357352
</Flex>
358353
)}
@@ -373,12 +368,12 @@ export const NFTGetAllTable: React.FC<ContractOverviewNFTGetAllProps> = ({
373368
icon={<ChevronLeftIcon className="size-4" />}
374369
onClick={() => previousPage()}
375370
/>
376-
<Text whiteSpace="nowrap">
371+
<p className="whitespace-nowrap">
377372
Page <strong>{pageIndex + 1}</strong> of{" "}
378373
<Skeleton as="span" display="inline" isLoaded={querySuccess}>
379374
<strong>{pageCount}</strong>
380375
</Skeleton>
381-
</Text>
376+
</p>
382377
<IconButton
383378
isDisabled={!canNextPage || queryLoading}
384379
aria-label="next page"

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/overview/components/listing-stats.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { SkeletonContainer } from "@/components/ui/skeleton";
21
import { useMemo } from "react";
32
import type { ThirdwebContract } from "thirdweb";
43
import { totalAuctions, totalListings } from "thirdweb/extensions/marketplace";
54
import { useReadContract } from "thirdweb/react";
5+
import { StatCard } from "./stat-card";
66

77
const TotalListingsStat: React.FC<{ contract: ThirdwebContract }> = ({
88
contract,
@@ -82,20 +82,3 @@ export const ListingStatsV3: React.FC<ListingStatsV3Props> = ({
8282
</div>
8383
);
8484
};
85-
86-
function StatCard(props: {
87-
value: string;
88-
isPending: boolean;
89-
label: string;
90-
}) {
91-
return (
92-
<dl className="block rounded-lg border border-border bg-muted/50 p-4">
93-
<dt className="mb-1.5 text-sm md:text-base">{props.label}</dt>
94-
<SkeletonContainer
95-
loadedData={props.isPending ? undefined : props.value}
96-
skeletonData={"0000"}
97-
render={(v) => <dd className="truncate font-semibold text-xl">{v}</dd>}
98-
/>
99-
</dl>
100-
);
101-
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { SkeletonContainer } from "@/components/ui/skeleton";
2+
3+
export function StatCard(props: {
4+
value: string;
5+
isPending: boolean;
6+
label: string;
7+
}) {
8+
return (
9+
<dl className="block rounded-lg border border-border bg-muted/50 p-4">
10+
<dt className="mb-1.5 text-sm md:text-base">{props.label}</dt>
11+
<SkeletonContainer
12+
loadedData={props.isPending ? undefined : props.value}
13+
skeletonData={"0000"}
14+
render={(v) => <dd className="truncate font-semibold text-xl">{v}</dd>}
15+
/>
16+
</dl>
17+
);
18+
}

0 commit comments

Comments
 (0)