Skip to content

Commit f506e78

Browse files
committed
fix disable condition
1 parent 888cd36 commit f506e78

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -514,12 +514,14 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
514514
name: params.contractMetadata?.name || "",
515515
contractURI: _contractURI,
516516
defaultAdmin: params.deployParams._defaultAdmin as string,
517-
platformFeeBps: isFeeExempt
518-
? Number(params.deployParams._platformFeeBps)
519-
: DEFAULT_FEE_BPS_NEW,
520-
platformFeeRecipient: isFeeExempt
521-
? (params.deployParams._platformFeeRecipient as string)
522-
: DEFAULT_FEE_RECIPIENT,
517+
platformFeeBps:
518+
metadata.version === "7.0.0" && isFeeExempt
519+
? Number(params.deployParams._platformFeeBps)
520+
: DEFAULT_FEE_BPS_NEW,
521+
platformFeeRecipient:
522+
metadata.version === "7.0.0" && isFeeExempt
523+
? (params.deployParams._platformFeeRecipient as string)
524+
: DEFAULT_FEE_RECIPIENT,
523525
trustedForwarders: params.deployParams._trustedForwarders
524526
? JSON.parse(params.deployParams._trustedForwarders as string)
525527
: undefined,
@@ -539,9 +541,10 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
539541
: isFeeExempt
540542
? Number(params.deployParams._platformFeeBps)
541543
: DEFAULT_FEE_BPS,
542-
platformFeeRecipient: isFeeExempt
543-
? (params.deployParams._platformFeeRecipient as string)
544-
: DEFAULT_FEE_RECIPIENT,
544+
platformFeeRecipient:
545+
!hasInbuiltDefaultFeeConfig && isFeeExempt
546+
? (params.deployParams._platformFeeRecipient as string)
547+
: DEFAULT_FEE_RECIPIENT,
545548
};
546549

547550
const salt = params.deployDeterministic
@@ -779,7 +782,11 @@ export const CustomContractForm: React.FC<CustomContractFormProps> = ({
779782
<PlatformFeeFieldset
780783
form={form}
781784
isMarketplace={isMarketplace}
782-
isFeeExempt={isFeeExempt}
785+
disabled={
786+
hasInbuiltDefaultFeeConfig ||
787+
(isMarketplace && metadata.version !== "7.0.0") ||
788+
!isFeeExempt
789+
}
783790
/>
784791
)}
785792

apps/dashboard/src/components/contract-components/contract-deploy-form/platform-fee-fieldset.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ import type { CustomContractDeploymentForm } from "./custom-contract";
88
interface PlatformFeeFieldsetProps {
99
form: CustomContractDeploymentForm;
1010
isMarketplace: boolean;
11-
isFeeExempt: boolean;
11+
disabled: boolean;
1212
}
1313

1414
export const PlatformFeeFieldset: React.FC<PlatformFeeFieldsetProps> = ({
1515
form,
1616
isMarketplace,
17-
isFeeExempt,
17+
disabled,
1818
}) => {
1919
return (
2020
<Fieldset legend="Platform fees">
2121
<div className="flex flex-col gap-4 md:flex-row">
22-
{isFeeExempt ? (
22+
{!disabled ? (
2323
<>
2424
<FormFieldSetup
2525
className="grow"

0 commit comments

Comments
 (0)