Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
"@chakra-ui/react": "^2.1.0",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"@thirdweb-dev/react": "^3.9.5",
"@thirdweb-dev/sdk": "^3.9.5",
"@thirdweb-dev/storage": "^1.0.10",
"@thirdweb-dev/react": "^3.11.8-nightly-0b1f5229-20230417214052",
"@thirdweb-dev/sdk": "^3.10.11-nightly-0b1f5229-20230417214052",
"@thirdweb-dev/storage": "^1.1.2",
"color": "^4.2.3",
"ethers": "^5.7.0",
"flat": "^5.0.2",
Expand Down
3 changes: 2 additions & 1 deletion scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ esbuild
bundle: true,
minify: true,
platform: "browser",
target: "es2018",
target: "es2020",
outdir: "./esout",


splitting: false,
write: false,
sourcemap: false,
define: {
global: 'globalThis',
process: JSON.stringify({
env: "production"
})
Expand Down
2 changes: 1 addition & 1 deletion src/embeds/erc1155.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { TokenMetadataPage } from "../shared/token-metadata-page";
interface Erc1155EmbedProps {
contractAddress: string;
tokenId: string;
colorScheme: ColorMode;
colorScheme: "light" | "dark";
primaryColor: string;
}

Expand Down
2 changes: 1 addition & 1 deletion src/embeds/erc20.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { fontsizeCss } from "../shared/theme/typography";
import { parseIpfsGateway } from "../utils/parseIpfsGateway";

interface Erc20EmbedProps {
colorScheme: ColorMode;
colorScheme: "light" | "dark";
primaryColor: string;
contractAddress: string;
}
Expand Down
9 changes: 2 additions & 7 deletions src/embeds/erc721.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
ChakraProvider,
ColorMode,
Flex,
useColorMode,
} from "@chakra-ui/react";
import { ChakraProvider, Flex, useColorMode } from "@chakra-ui/react";
import { css, Global } from "@emotion/react";
import { ThirdwebProvider, useContract } from "@thirdweb-dev/react";
import { ThirdwebStorage } from "@thirdweb-dev/storage";
Expand All @@ -21,7 +16,7 @@ import { parseIpfsGateway } from "../utils/parseIpfsGateway";

interface Erc721EmbedProps {
contractAddress: string;
colorScheme: ColorMode;
colorScheme: "light" | "dark";
primaryColor: string;
}

Expand Down
22 changes: 14 additions & 8 deletions src/embeds/marketplace-v3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ interface MarketplaceV3EmbedProps {
rpcUrl?: string;
contractAddress: string;
listingId: string;
colorScheme: ColorMode;
colorScheme: "light" | "dark";
primaryColor: string;
secondaryColor: string;
type: string;
Expand All @@ -68,7 +68,7 @@ interface BuyPageProps {
isLoading?: boolean;
primaryColor: string;
secondaryColor: string;
colorScheme: ColorMode;
colorScheme: "light" | "dark";
type: string;
}

Expand Down Expand Up @@ -217,8 +217,10 @@ const EnglishAuctionComponent: React.FC<EnglishAuctionProps> = ({
<LightMode>
<Web3Button
contractAddress={contract?.getAddress() || ""}
accentColor={accentColor}
colorMode={colorScheme}
style={{
backgroundColor: accentColor,
}}
theme={colorScheme}
isDisabled={
parseFloat(bid) <
parseFloat(valuesFormatted.mimimumBidNumber.toString())
Expand Down Expand Up @@ -264,8 +266,10 @@ const EnglishAuctionComponent: React.FC<EnglishAuctionProps> = ({
<LightMode>
<Web3Button
contractAddress={contract?.getAddress() || ""}
accentColor={accentColor}
colorMode={colorScheme}
style={{
backgroundColor: accentColor,
}}
theme={colorScheme}
action={() =>
contract?.englishAuctions.buyoutAuction(listing.id)
}
Expand Down Expand Up @@ -509,8 +513,10 @@ const DirectListingComponent: React.FC<DirectListingProps> = ({
<LightMode>
<Web3Button
contractAddress={contract?.getAddress() || ""}
accentColor={accentColor}
colorMode={colorScheme}
style={{
backgroundColor: accentColor,
}}
theme={colorScheme}
isDisabled={!canClaim}
action={() =>
contract?.directListings.buyFromListing(listing.id, quantity)
Expand Down
22 changes: 14 additions & 8 deletions src/embeds/marketplace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ interface MarketplaceEmbedProps {
rpcUrl?: string;
contractAddress: string;
listingId: string;
colorScheme: ColorMode;
colorScheme: "light" | "dark";
primaryColor: string;
secondaryColor: string;
}
Expand All @@ -66,7 +66,7 @@ interface BuyPageProps {
isLoading?: boolean;
primaryColor: string;
secondaryColor: string;
colorScheme: ColorMode;
colorScheme: "light" | "dark";
}

interface AuctionListingProps extends BuyPageProps {
Expand Down Expand Up @@ -212,8 +212,10 @@ const AuctionListingComponent: React.FC<AuctionListingProps> = ({
<LightMode>
<Web3Button
contractAddress={contract?.getAddress() || ""}
accentColor={accentColor}
colorMode={colorScheme}
style={{
backgroundColor: accentColor,
}}
theme={colorScheme}
isDisabled={
parseFloat(bid) <
parseFloat(valuesFormatted.mimimumBidNumber.toString())
Expand Down Expand Up @@ -259,8 +261,10 @@ const AuctionListingComponent: React.FC<AuctionListingProps> = ({
<LightMode>
<Web3Button
contractAddress={contract?.getAddress() || ""}
accentColor={accentColor}
colorMode={colorScheme}
style={{
backgroundColor: accentColor,
}}
theme={colorScheme}
action={() => contract?.buyoutListing(listing.id)}
onSuccess={() => {
toast({
Expand Down Expand Up @@ -502,8 +506,10 @@ const DirectListingComponent: React.FC<DirectListingProps> = ({
<LightMode>
<Web3Button
contractAddress={contract?.getAddress() || ""}
accentColor={accentColor}
colorMode={colorScheme}
style={{
backgroundColor: accentColor,
}}
theme={colorScheme}
isDisabled={!canClaim}
action={() => contract?.buyoutListing(listing.id, quantity)}
onSuccess={() => {
Expand Down
8 changes: 5 additions & 3 deletions src/shared/claim-button-erc1155.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface ClaimButtonProps {
contract?: Exclude<DropContract, TokenDrop | SignatureDrop | NFTDrop>;
tokenId: BigNumberish;
primaryColor: string;
colorScheme: ColorMode;
colorScheme: "light" | "dark";
}

export const ERC1155ClaimButton: React.FC<ClaimButtonProps> = ({
Expand Down Expand Up @@ -296,11 +296,13 @@ export const ERC1155ClaimButton: React.FC<ClaimButtonProps> = ({
</Skeleton>
)}
<Web3Button
colorMode={colorScheme}
theme={colorScheme}
contractAddress={contract?.getAddress() || ""}
action={(cntr) => cntr.erc1155.claim(tokenId, quantity)}
isDisabled={!canClaim || buttonLoading}
accentColor={accentColor}
style={{
backgroundColor: accentColor,
}}
onError={(err) => {
console.error(err);
toast({
Expand Down
8 changes: 5 additions & 3 deletions src/shared/claim-button-erc20.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import chakraTheme from "./theme";
interface ClaimButtonProps {
contract?: Exclude<DropContract, EditionDrop | SignatureDrop | NFTDrop>;
primaryColor: string;
colorScheme: ColorMode;
colorScheme: "light" | "dark";
}

export const ERC20ClaimButton: React.FC<ClaimButtonProps> = ({
Expand Down Expand Up @@ -289,11 +289,13 @@ export const ERC20ClaimButton: React.FC<ClaimButtonProps> = ({
</Skeleton>
)}
<Web3Button
colorMode={colorScheme}
theme={colorScheme}
contractAddress={contract?.getAddress() || ""}
action={(cntr) => cntr.erc20.claim(quantity)}
isDisabled={!canClaim || buttonLoading}
accentColor={accentColor}
style={{
backgroundColor: accentColor,
}}
onError={(err) => {
console.error(err);
toast({
Expand Down
10 changes: 6 additions & 4 deletions src/shared/claim-button-erc721.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
ColorMode,
Flex,
NumberDecrementStepper,
NumberIncrementStepper,
Expand Down Expand Up @@ -33,7 +32,7 @@ import chakraTheme from "./theme";
interface ClaimButtonProps {
contract?: Exclude<DropContract, TokenDrop | EditionDrop>;
primaryColor: string;
colorScheme: ColorMode;
colorScheme: "light" | "dark";
}

export const ERC721ClaimButton: React.FC<ClaimButtonProps> = ({
Expand Down Expand Up @@ -291,11 +290,14 @@ export const ERC721ClaimButton: React.FC<ClaimButtonProps> = ({
</Skeleton>
)}
<Web3Button
colorMode={colorScheme}
style={{
backgroundColor: accentColor,
color: "white",
}}
theme={colorScheme}
contractAddress={contract?.getAddress() || ""}
action={(cntr) => cntr.erc721.claim(quantity)}
isDisabled={!canClaim || buttonLoading}
accentColor={accentColor}
onError={(err) => {
console.error(err);
toast({
Expand Down
14 changes: 3 additions & 11 deletions src/shared/header.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
import { Stack } from "@chakra-ui/react";
import { ConnectWallet } from "@thirdweb-dev/react";
import { ColorMode } from "@thirdweb-dev/react/dist/declarations/src/evm/components/theme";
import React from "react";
import chakraTheme from "./theme";

interface HeaderProps {
primaryColor: string;
colorScheme: ColorMode;
colorScheme: "light" | "dark";
}

export const Header: React.FC<HeaderProps> = ({
primaryColor,
colorScheme,
}) => {
const colors = chakraTheme.colors;
const accentColor = colors[primaryColor as keyof typeof colors][500];

export const Header: React.FC<HeaderProps> = ({ colorScheme }) => {
return (
<Stack
as="header"
Expand All @@ -28,7 +20,7 @@ export const Header: React.FC<HeaderProps> = ({
justify="flex-end"
py={2}
>
<ConnectWallet accentColor={accentColor} colorMode={colorScheme} />
<ConnectWallet theme={colorScheme} />
</Stack>
);
};
Loading