Skip to content

Commit aa5d040

Browse files
committed
remove extra prop requirements
1 parent 1b16162 commit aa5d040

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/mintable.stories.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ function Component() {
106106
<BadgeContainer label="Empty Primary Sale Recipient">
107107
<MintableModuleUI
108108
contractInfo={contractInfo}
109-
allModuleContractInfo={[]}
110109
moduleAddress="0x0000000000000000000000000000000000000000"
111110
isPending={false}
112111
primarySaleRecipient={""}
@@ -126,7 +125,6 @@ function Component() {
126125
<BadgeContainer label="Filled Primary Sale Recipient">
127126
<MintableModuleUI
128127
contractInfo={contractInfo}
129-
allModuleContractInfo={[]}
130128
moduleAddress="0x0000000000000000000000000000000000000000"
131129
isPending={false}
132130
primarySaleRecipient={testAddress1}
@@ -146,7 +144,6 @@ function Component() {
146144
<BadgeContainer label="Pending">
147145
<MintableModuleUI
148146
contractInfo={contractInfo}
149-
allModuleContractInfo={[]}
150147
moduleAddress="0x0000000000000000000000000000000000000000"
151148
isPending={true}
152149
primarySaleRecipient={testAddress1}

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/module-card.stories.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ function Component() {
7272
<BadgeContainer label="No Update, No Children">
7373
<ModuleCardUI
7474
contractInfo={contractInfo}
75-
allModuleContractInfo={[]}
7675
moduleAddress="0x0000000000000000000000000000000000000000"
7776
uninstallButton={{
7877
onClick: () => removeMutation.mutateAsync(),
@@ -85,7 +84,6 @@ function Component() {
8584
<BadgeContainer label="Update Button (disabled), No Children">
8685
<ModuleCardUI
8786
contractInfo={contractInfo}
88-
allModuleContractInfo={[]}
8987
moduleAddress="0x0000000000000000000000000000000000000000"
9088
uninstallButton={{
9189
onClick: () => removeMutation.mutateAsync(),
@@ -103,7 +101,6 @@ function Component() {
103101
<BadgeContainer label="Update Button (enabled), Children, Owner">
104102
<ModuleCardUI
105103
contractInfo={contractInfo}
106-
allModuleContractInfo={[]}
107104
moduleAddress="0x0000000000000000000000000000000000000000"
108105
uninstallButton={{
109106
onClick: () => removeMutation.mutateAsync(),

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/module-card.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,26 @@ import {
2525
sendTransaction,
2626
waitForReceipt,
2727
} from "thirdweb";
28-
import type { CompilerMetadata } from "thirdweb/dist/types/utils/any-evm/deploy-metadata";
2928
import { uninstallModuleByProxy } from "thirdweb/modules";
3029
import type { Account } from "thirdweb/wallets";
3130
import { ModuleInstance } from "./module-instance";
3231
import { useModuleContractInfo } from "./moduleContractInfo";
3332

34-
type ModuleCardProps = {
33+
export type ModuleCardProps = {
3534
moduleAddress: string;
3635
contract: ContractOptions;
3736
onRemoveModule: () => void;
3837
ownerAccount: Account | undefined;
39-
allModuleContractInfo: CompilerMetadata[];
38+
allModuleContractInfo: {
39+
name: string;
40+
description?: string;
41+
version?: string;
42+
publisher?: string;
43+
}[];
4044
};
4145

4246
export function ModuleCard(props: ModuleCardProps) {
43-
const { contract, moduleAddress, ownerAccount, allModuleContractInfo } =
44-
props;
47+
const { contract, moduleAddress, ownerAccount } = props;
4548
const [isUninstallModalOpen, setIsUninstallModalOpen] = useState(false);
4649

4750
const contractInfo = useModuleContractInfo(
@@ -103,7 +106,6 @@ export function ModuleCard(props: ModuleCardProps) {
103106
publisher: contractInfo.publisher,
104107
version: contractInfo.version,
105108
}}
106-
allModuleContractInfo={allModuleContractInfo}
107109
ownerAccount={ownerAccount}
108110
uninstallButton={{
109111
onClick: () => {
@@ -112,6 +114,7 @@ export function ModuleCard(props: ModuleCardProps) {
112114
isPending: uninstallMutation.isPending,
113115
}}
114116
moduleAddress={moduleAddress}
117+
allModuleContractInfo={props.allModuleContractInfo}
115118
/>
116119
</Suspense>
117120

@@ -172,12 +175,6 @@ export type ModuleCardUIProps = {
172175
version?: string;
173176
publisher?: string;
174177
};
175-
allModuleContractInfo: {
176-
name: string;
177-
description?: string;
178-
version?: string;
179-
publisher?: string;
180-
}[];
181178
moduleAddress: string;
182179
isOwnerAccount: boolean;
183180
uninstallButton: {

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/module-instance.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ export type ModuleInstanceProps = Omit<
1414
> & {
1515
contract: ThirdwebContract;
1616
ownerAccount: Account | undefined;
17+
allModuleContractInfo: {
18+
name: string;
19+
description?: string;
20+
version?: string;
21+
publisher?: string;
22+
}[];
1723
};
1824

1925
export function ModuleInstance(props: ModuleInstanceProps) {

apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/modules/components/transferable.stories.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ function Component() {
7878
<BadgeContainer label="Empty AllowList, Not Restricted">
7979
<TransferableModuleUI
8080
contractInfo={contractInfo}
81-
allModuleContractInfo={[]}
8281
moduleAddress="0x0000000000000000000000000000000000000000"
8382
isPending={false}
8483
isRestricted={false}
@@ -95,7 +94,6 @@ function Component() {
9594
<BadgeContainer label="Empty AllowList, Restricted">
9695
<TransferableModuleUI
9796
contractInfo={contractInfo}
98-
allModuleContractInfo={[]}
9997
moduleAddress="0x0000000000000000000000000000000000000000"
10098
isPending={false}
10199
isRestricted={true}
@@ -112,7 +110,6 @@ function Component() {
112110
<BadgeContainer label="Pending">
113111
<TransferableModuleUI
114112
contractInfo={contractInfo}
115-
allModuleContractInfo={[]}
116113
moduleAddress="0x0000000000000000000000000000000000000000"
117114
isPending={true}
118115
adminAddress={testAddress1}

0 commit comments

Comments
 (0)