Skip to content

Commit faa5864

Browse files
committed
Merge remote-tracking branch 'origin' into ian/ftux
2 parents 5750684 + 3cf0039 commit faa5864

File tree

19 files changed

+283
-248
lines changed

19 files changed

+283
-248
lines changed

apps/dashboard/src/@/constants/auth.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const LOGGED_IN_ONLY_PATHS = [
55
"/team",
66
// anything that _starts_ with /cli is logged in only
77
"/cli",
8-
"/support",
98
// publish page
109
"/contracts/publish",
1110
];

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
@@ -47,7 +47,7 @@ export function FaucetButton({
4747
amount,
4848
}: {
4949
chain: ChainMetadata;
50-
amount: string;
50+
amount: number;
5151
}) {
5252
const client = useThirdwebClient();
5353
const address = useActiveAccount()?.address;

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/FaucetSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import type { ChainMetadata } from "thirdweb/chains";
2+
import { getFaucetClaimAmount } from "../../../../../../api/testnet-faucet/claim/claim-amount";
23
import { ChainIcon } from "../../../../components/server/chain-icon";
34
import { FaucetButton } from "../client/FaucetButton";
45
import { GiftIcon } from "../icons/GiftIcon";
56
import { SectionTitle } from "./SectionTitle";
67

7-
const amountToGive = "0.01";
8-
98
export async function FaucetSection(props: { chain: ChainMetadata }) {
109
const { chain } = props;
1110

1211
// Check eligibilty.
1312
const sanitizedChainName = chain.name.replace("Mainnet", "").trim();
13+
const amountToGive = getFaucetClaimAmount(props.chain.chainId);
1414

1515
return (
1616
<section>

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/_components/claim-conditions/claim-conditions-form/index.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import { Spinner } from "@/components/ui/Spinner/Spinner";
34
import { ToolTipLabel } from "@/components/ui/tooltip";
45
import { AdminOnly } from "@3rdweb-sdk/react/components/roles/admin-only";
56
import { useIsAdmin } from "@3rdweb-sdk/react/hooks/useContractRoles";
@@ -13,7 +14,6 @@ import {
1314
Menu,
1415
MenuButton,
1516
MenuList,
16-
Spinner,
1717
} from "@chakra-ui/react";
1818
import { TransactionButton } from "components/buttons/TransactionButton";
1919
import { useTrack } from "hooks/analytics/useTrack";
@@ -445,19 +445,16 @@ export const ClaimConditionsForm: React.FC<ClaimConditionsFormProps> = ({
445445
};
446446
}, [claimConditionsQuery.data, controlledFields, isMultiPhase]);
447447

448+
if (isFetchingData) {
449+
return (
450+
<div className="flex h-[400px] w-full items-center justify-center rounded-lg border border-border">
451+
<Spinner className="size-10" />
452+
</div>
453+
);
454+
}
455+
448456
return (
449457
<>
450-
{/* spinner */}
451-
{isFetchingData && (
452-
<Spinner
453-
color="primary"
454-
size="xs"
455-
position="absolute"
456-
top={2}
457-
right={4}
458-
/>
459-
)}
460-
461458
<Flex onSubmit={handleFormSubmit} direction="column" as="form" gap={10}>
462459
<Flex direction="column" gap={6}>
463460
{/* Show the reason why the form is disabled */}
@@ -553,7 +550,7 @@ export const ClaimConditionsForm: React.FC<ClaimConditionsFormProps> = ({
553550

554551
<Flex
555552
justifyContent="space-between"
556-
flexDir={{ base: "column", md: isColumn ? "column" : "row" }}
553+
flexDir={{ base: "column", md: "row" }}
557554
gap={2}
558555
>
559556
<div className="flex flex-row gap-2">

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/_components/claim-conditions/claim-conditions.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@ export const ClaimConditions: React.FC<ClaimConditionsProps> = ({
1919
return (
2020
<div className="flex w-full flex-col gap-8">
2121
<Flex p={0} position="relative">
22-
<Flex
23-
pt={{ base: isColumn ? 0 : 6, md: 6 }}
24-
direction="column"
25-
gap={8}
26-
w="full"
27-
>
22+
<Flex direction="column" gap={6} w="full">
2823
{/* Info */}
2924
<section>
3025
<h2 className="mb-1 font-semibold text-xl tracking-tight">

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DeprecatedAlert } from "components/shared/DeprecatedAlert";
55
import type { Metadata } from "next";
66
import { notFound } from "next/navigation";
77
import { getContractMetadata } from "thirdweb/extensions/common";
8-
import { isContractDeployed } from "thirdweb/utils";
8+
import { isAddress, isContractDeployed } from "thirdweb/utils";
99
import { resolveFunctionSelectors } from "../../../../../lib/selectors";
1010
import { shortenIfAddress } from "../../../../../utils/usedapp-external";
1111
import { ConfigureCustomChain } from "./ConfigureCustomChain";
@@ -22,20 +22,29 @@ export default async function Layout(props: {
2222
};
2323
children: React.ReactNode;
2424
}) {
25+
if (!isAddress(props.params.contractAddress)) {
26+
return notFound();
27+
}
28+
2529
const info = await getContractPageParamsInfo(props.params);
2630

2731
if (!info) {
2832
return <ConfigureCustomChain chainSlug={props.params.chain_id} />;
2933
}
3034

35+
const { contract, chainMetadata } = info;
36+
37+
if (chainMetadata.status === "deprecated") {
38+
notFound();
39+
}
40+
3141
// check if the contract exists
32-
const isValidContract = await isContractDeployed(info.contract);
42+
const isValidContract = await isContractDeployed(contract);
3343
if (!isValidContract) {
3444
// TODO - replace 404 with a better page to upsale deploy or other thirdweb products
3545
notFound();
3646
}
3747

38-
const { contract, chainMetadata } = info;
3948
const contractPageMetadata = await getContractPageMetadata(contract);
4049
const sidebarLinks = getContractPageSidebarLinks({
4150
chainSlug: chainMetadata.slug,

apps/dashboard/src/app/(dashboard)/support/components/create-ticket.client.tsx

Lines changed: 0 additions & 187 deletions
This file was deleted.

0 commit comments

Comments
 (0)