Skip to content

Commit bc02f89

Browse files
Update SDKs (#98)
* wip * fix * Use nightly * Fix build error * Stable storage * Style changes --------- Co-authored-by: Manan Tank <[email protected]>
1 parent b00148d commit bc02f89

File tree

12 files changed

+1981
-1060
lines changed

12 files changed

+1981
-1060
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
"@chakra-ui/react": "^2.1.0",
5050
"@emotion/react": "^11",
5151
"@emotion/styled": "^11",
52-
"@thirdweb-dev/react": "^3.9.5",
53-
"@thirdweb-dev/sdk": "^3.9.5",
54-
"@thirdweb-dev/storage": "^1.0.10",
52+
"@thirdweb-dev/react": "^3.11.8-nightly-0b1f5229-20230417214052",
53+
"@thirdweb-dev/sdk": "^3.10.11-nightly-0b1f5229-20230417214052",
54+
"@thirdweb-dev/storage": "^1.1.2",
5555
"color": "^4.2.3",
5656
"ethers": "^5.7.0",
5757
"flat": "^5.0.2",

scripts/build.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ esbuild
1616
bundle: true,
1717
minify: true,
1818
platform: "browser",
19-
target: "es2018",
19+
target: "es2020",
2020
outdir: "./esout",
2121

2222

2323
splitting: false,
2424
write: false,
2525
sourcemap: false,
2626
define: {
27+
global: 'globalThis',
2728
process: JSON.stringify({
2829
env: "production"
2930
})

src/embeds/erc1155.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { TokenMetadataPage } from "../shared/token-metadata-page";
2222
interface Erc1155EmbedProps {
2323
contractAddress: string;
2424
tokenId: string;
25-
colorScheme: ColorMode;
25+
colorScheme: "light" | "dark";
2626
primaryColor: string;
2727
}
2828

src/embeds/erc20.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { fontsizeCss } from "../shared/theme/typography";
2020
import { parseIpfsGateway } from "../utils/parseIpfsGateway";
2121

2222
interface Erc20EmbedProps {
23-
colorScheme: ColorMode;
23+
colorScheme: "light" | "dark";
2424
primaryColor: string;
2525
contractAddress: string;
2626
}

src/embeds/erc721.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
ChakraProvider,
3-
ColorMode,
4-
Flex,
5-
useColorMode,
6-
} from "@chakra-ui/react";
1+
import { ChakraProvider, Flex, useColorMode } from "@chakra-ui/react";
72
import { css, Global } from "@emotion/react";
83
import { ThirdwebProvider, useContract } from "@thirdweb-dev/react";
94
import { ThirdwebStorage } from "@thirdweb-dev/storage";
@@ -21,7 +16,7 @@ import { parseIpfsGateway } from "../utils/parseIpfsGateway";
2116

2217
interface Erc721EmbedProps {
2318
contractAddress: string;
24-
colorScheme: ColorMode;
19+
colorScheme: "light" | "dark";
2520
primaryColor: string;
2621
}
2722

src/embeds/marketplace-v3.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ interface MarketplaceV3EmbedProps {
5656
rpcUrl?: string;
5757
contractAddress: string;
5858
listingId: string;
59-
colorScheme: ColorMode;
59+
colorScheme: "light" | "dark";
6060
primaryColor: string;
6161
secondaryColor: string;
6262
type: string;
@@ -68,7 +68,7 @@ interface BuyPageProps {
6868
isLoading?: boolean;
6969
primaryColor: string;
7070
secondaryColor: string;
71-
colorScheme: ColorMode;
71+
colorScheme: "light" | "dark";
7272
type: string;
7373
}
7474

@@ -217,8 +217,10 @@ const EnglishAuctionComponent: React.FC<EnglishAuctionProps> = ({
217217
<LightMode>
218218
<Web3Button
219219
contractAddress={contract?.getAddress() || ""}
220-
accentColor={accentColor}
221-
colorMode={colorScheme}
220+
style={{
221+
backgroundColor: accentColor,
222+
}}
223+
theme={colorScheme}
222224
isDisabled={
223225
parseFloat(bid) <
224226
parseFloat(valuesFormatted.mimimumBidNumber.toString())
@@ -264,8 +266,10 @@ const EnglishAuctionComponent: React.FC<EnglishAuctionProps> = ({
264266
<LightMode>
265267
<Web3Button
266268
contractAddress={contract?.getAddress() || ""}
267-
accentColor={accentColor}
268-
colorMode={colorScheme}
269+
style={{
270+
backgroundColor: accentColor,
271+
}}
272+
theme={colorScheme}
269273
action={() =>
270274
contract?.englishAuctions.buyoutAuction(listing.id)
271275
}
@@ -509,8 +513,10 @@ const DirectListingComponent: React.FC<DirectListingProps> = ({
509513
<LightMode>
510514
<Web3Button
511515
contractAddress={contract?.getAddress() || ""}
512-
accentColor={accentColor}
513-
colorMode={colorScheme}
516+
style={{
517+
backgroundColor: accentColor,
518+
}}
519+
theme={colorScheme}
514520
isDisabled={!canClaim}
515521
action={() =>
516522
contract?.directListings.buyFromListing(listing.id, quantity)

src/embeds/marketplace.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ interface MarketplaceEmbedProps {
5555
rpcUrl?: string;
5656
contractAddress: string;
5757
listingId: string;
58-
colorScheme: ColorMode;
58+
colorScheme: "light" | "dark";
5959
primaryColor: string;
6060
secondaryColor: string;
6161
}
@@ -66,7 +66,7 @@ interface BuyPageProps {
6666
isLoading?: boolean;
6767
primaryColor: string;
6868
secondaryColor: string;
69-
colorScheme: ColorMode;
69+
colorScheme: "light" | "dark";
7070
}
7171

7272
interface AuctionListingProps extends BuyPageProps {
@@ -212,8 +212,10 @@ const AuctionListingComponent: React.FC<AuctionListingProps> = ({
212212
<LightMode>
213213
<Web3Button
214214
contractAddress={contract?.getAddress() || ""}
215-
accentColor={accentColor}
216-
colorMode={colorScheme}
215+
style={{
216+
backgroundColor: accentColor,
217+
}}
218+
theme={colorScheme}
217219
isDisabled={
218220
parseFloat(bid) <
219221
parseFloat(valuesFormatted.mimimumBidNumber.toString())
@@ -259,8 +261,10 @@ const AuctionListingComponent: React.FC<AuctionListingProps> = ({
259261
<LightMode>
260262
<Web3Button
261263
contractAddress={contract?.getAddress() || ""}
262-
accentColor={accentColor}
263-
colorMode={colorScheme}
264+
style={{
265+
backgroundColor: accentColor,
266+
}}
267+
theme={colorScheme}
264268
action={() => contract?.buyoutListing(listing.id)}
265269
onSuccess={() => {
266270
toast({
@@ -502,8 +506,10 @@ const DirectListingComponent: React.FC<DirectListingProps> = ({
502506
<LightMode>
503507
<Web3Button
504508
contractAddress={contract?.getAddress() || ""}
505-
accentColor={accentColor}
506-
colorMode={colorScheme}
509+
style={{
510+
backgroundColor: accentColor,
511+
}}
512+
theme={colorScheme}
507513
isDisabled={!canClaim}
508514
action={() => contract?.buyoutListing(listing.id, quantity)}
509515
onSuccess={() => {

src/shared/claim-button-erc1155.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ interface ClaimButtonProps {
3333
contract?: Exclude<DropContract, TokenDrop | SignatureDrop | NFTDrop>;
3434
tokenId: BigNumberish;
3535
primaryColor: string;
36-
colorScheme: ColorMode;
36+
colorScheme: "light" | "dark";
3737
}
3838

3939
export const ERC1155ClaimButton: React.FC<ClaimButtonProps> = ({
@@ -296,11 +296,13 @@ export const ERC1155ClaimButton: React.FC<ClaimButtonProps> = ({
296296
</Skeleton>
297297
)}
298298
<Web3Button
299-
colorMode={colorScheme}
299+
theme={colorScheme}
300300
contractAddress={contract?.getAddress() || ""}
301301
action={(cntr) => cntr.erc1155.claim(tokenId, quantity)}
302302
isDisabled={!canClaim || buttonLoading}
303-
accentColor={accentColor}
303+
style={{
304+
backgroundColor: accentColor,
305+
}}
304306
onError={(err) => {
305307
console.error(err);
306308
toast({

src/shared/claim-button-erc20.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import chakraTheme from "./theme";
3232
interface ClaimButtonProps {
3333
contract?: Exclude<DropContract, EditionDrop | SignatureDrop | NFTDrop>;
3434
primaryColor: string;
35-
colorScheme: ColorMode;
35+
colorScheme: "light" | "dark";
3636
}
3737

3838
export const ERC20ClaimButton: React.FC<ClaimButtonProps> = ({
@@ -289,11 +289,13 @@ export const ERC20ClaimButton: React.FC<ClaimButtonProps> = ({
289289
</Skeleton>
290290
)}
291291
<Web3Button
292-
colorMode={colorScheme}
292+
theme={colorScheme}
293293
contractAddress={contract?.getAddress() || ""}
294294
action={(cntr) => cntr.erc20.claim(quantity)}
295295
isDisabled={!canClaim || buttonLoading}
296-
accentColor={accentColor}
296+
style={{
297+
backgroundColor: accentColor,
298+
}}
297299
onError={(err) => {
298300
console.error(err);
299301
toast({

src/shared/claim-button-erc721.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
ColorMode,
32
Flex,
43
NumberDecrementStepper,
54
NumberIncrementStepper,
@@ -33,7 +32,7 @@ import chakraTheme from "./theme";
3332
interface ClaimButtonProps {
3433
contract?: Exclude<DropContract, TokenDrop | EditionDrop>;
3534
primaryColor: string;
36-
colorScheme: ColorMode;
35+
colorScheme: "light" | "dark";
3736
}
3837

3938
export const ERC721ClaimButton: React.FC<ClaimButtonProps> = ({
@@ -291,11 +290,14 @@ export const ERC721ClaimButton: React.FC<ClaimButtonProps> = ({
291290
</Skeleton>
292291
)}
293292
<Web3Button
294-
colorMode={colorScheme}
293+
style={{
294+
backgroundColor: accentColor,
295+
color: "white",
296+
}}
297+
theme={colorScheme}
295298
contractAddress={contract?.getAddress() || ""}
296299
action={(cntr) => cntr.erc721.claim(quantity)}
297300
isDisabled={!canClaim || buttonLoading}
298-
accentColor={accentColor}
299301
onError={(err) => {
300302
console.error(err);
301303
toast({

0 commit comments

Comments
 (0)