-
Notifications
You must be signed in to change notification settings - Fork 619
Dashboard: Reduce useThirdwebClient hook usage #2 #7224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dashboard: Reduce useThirdwebClient hook usage #2 #7224
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis change refactors multiple components and hooks to require a Changes
Sequence Diagram(s)sequenceDiagram
participant ParentComponent
participant ChildComponent
participant SolidityInput
participant ThirdwebClient
ParentComponent->>ChildComponent: Render with client=ThirdwebClient
ChildComponent->>SolidityInput: Render with client=ThirdwebClient
SolidityInput->>ThirdwebClient: Use client for operations (e.g., validation, upload)
Possibly related PRs
Suggested labels
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7224 +/- ##
=======================================
Coverage 55.62% 55.62%
=======================================
Files 908 908
Lines 58575 58575
Branches 4134 4134
=======================================
Hits 32582 32582
Misses 25887 25887
Partials 106 106
🚀 New features to boost your workflow:
|
size-limit report 📦
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/ecosystem-header.client.tsx (1)
152-152:⚠️ Potential issueInconsistent client usage - should use props.client consistently.
The component has mixed client usage patterns:
- Lines 169-171: Uses
props.clientfor storage upload (✓ correct)- Line 152: Still uses
useThirdwebClient()hook- Line 158: Uses the hook-derived client for
resolveSchemeWithErrorHandlerThis contradicts the PR objective of reducing
useThirdwebClienthook usage.Apply this diff to use
props.clientconsistently:- const client = useThirdwebClient(); - const ecosystem = fetchedEcosystem ?? props.ecosystem; const ecosystemImageLink = resolveSchemeWithErrorHandler({ uri: ecosystem.imageUrl, - client, + client: props.client, });And remove the unused import if no longer needed:
- import { useThirdwebClient } from "@/constants/thirdweb.client";Also applies to: 158-158
🧹 Nitpick comments (1)
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/EcosystemSlugLayout.tsx (1)
41-44: Consider adding error handling for client creation.The client creation looks correct with proper authentication context (teamId and JWT), but consider adding error handling in case
getClientThirdwebClientfails.const client = getClientThirdwebClient({ teamId: team.id, jwt: authToken, });Could be enhanced with error handling:
+ try { const client = getClientThirdwebClient({ teamId: team.id, jwt: authToken, }); + } catch (error) { + console.error('Failed to create Thirdweb client:', error); + redirect(ecosystemLayoutPath); + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (35)
apps/dashboard/src/@3rdweb-sdk/react/components/connect-wallet/index.tsx(6 hunks)apps/dashboard/src/@3rdweb-sdk/react/hooks/useDashboardStorageUpload.tsx(1 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client/FaucetButton.tsx(1 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client/add-chain-to-wallet.tsx(3 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/chain-header.tsx(3 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx(2 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/list-form.tsx(1 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/transfer-tab.tsx(1 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/platform-fees.tsx(1 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/primary-sale.tsx(1 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/royalties.tsx(1 hunks)apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/components/transfer-button.tsx(1 hunks)apps/dashboard/src/app/(app)/account/components/AccountHeader.tsx(1 hunks)apps/dashboard/src/app/(app)/drops/[slug]/mint-ui.tsx(2 hunks)apps/dashboard/src/app/(app)/providers.tsx(3 hunks)apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/EcosystemSlugLayout.tsx(2 hunks)apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/ecosystem-header.client.tsx(3 hunks)apps/dashboard/src/app/(app)/team/components/TeamHeader/team-header-logged-in.client.tsx(1 hunks)apps/dashboard/src/components/configure-networks/ConfigureNetworkForm.tsx(1 hunks)apps/dashboard/src/components/configure-networks/Form/IconUpload.tsx(1 hunks)apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx(11 hunks)apps/dashboard/src/components/contract-components/contract-deploy-form/modular-contract-default-modules-fieldset.tsx(13 hunks)apps/dashboard/src/components/contract-components/contract-deploy-form/param.tsx(3 hunks)apps/dashboard/src/components/contract-components/contract-deploy-form/platform-fee-fieldset.tsx(2 hunks)apps/dashboard/src/components/contract-components/contract-deploy-form/primary-sale-fieldset.tsx(2 hunks)apps/dashboard/src/components/contract-components/contract-deploy-form/royalty-fieldset.tsx(4 hunks)apps/dashboard/src/components/contract-components/contract-deploy-form/sequential-token-id-fieldset.tsx(2 hunks)apps/dashboard/src/components/contract-components/contract-deploy-form/split-fieldset.tsx(2 hunks)apps/dashboard/src/components/contract-components/contract-deploy-form/trusted-forwarders-fieldset.tsx(3 hunks)apps/dashboard/src/components/contract-components/contract-publish-form/contract-params-fieldset.tsx(2 hunks)apps/dashboard/src/components/contract-components/contract-publish-form/impl-params-fieldset.tsx(2 hunks)apps/dashboard/src/components/contract-components/contract-publish-form/index.tsx(2 hunks)apps/dashboard/src/components/contract-components/contract-publish-form/landing-fieldset.tsx(1 hunks)apps/dashboard/src/contract-ui/components/solidity-inputs/index.tsx(3 hunks)apps/dashboard/src/contract-ui/components/solidity-inputs/string-input.tsx(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (13)
apps/dashboard/src/components/configure-networks/ConfigureNetworkForm.tsx (1)
packages/engine/src/client/client.gen.ts (1)
client(24-28)
apps/dashboard/src/components/contract-components/contract-publish-form/landing-fieldset.tsx (1)
packages/engine/src/client/client.gen.ts (1)
client(24-28)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx (1)
packages/engine/src/client/client.gen.ts (1)
client(24-28)
apps/dashboard/src/app/(app)/account/components/AccountHeader.tsx (2)
apps/dashboard/src/@3rdweb-sdk/react/components/connect-wallet/index.tsx (1)
CustomConnectWallet(32-204)packages/engine/src/client/client.gen.ts (1)
client(24-28)
apps/dashboard/src/components/configure-networks/Form/IconUpload.tsx (2)
packages/thirdweb/src/exports/thirdweb.ts (1)
ThirdwebClient(26-26)apps/dashboard/src/@3rdweb-sdk/react/hooks/useDashboardStorageUpload.tsx (1)
useDashboardStorageUpload(11-26)
apps/dashboard/src/components/contract-components/contract-deploy-form/sequential-token-id-fieldset.tsx (1)
apps/dashboard/src/contract-ui/components/solidity-inputs/index.tsx (1)
SolidityInput(51-121)
apps/dashboard/src/components/contract-components/contract-publish-form/index.tsx (3)
apps/dashboard/src/components/contract-components/contract-publish-form/contract-params-fieldset.tsx (1)
ContractParamsFieldset(23-313)apps/dashboard/src/components/contract-components/contract-publish-form/impl-params-fieldset.tsx (1)
ImplementationParamsFieldset(17-179)apps/dashboard/src/@3rdweb-sdk/react/components/connect-wallet/index.tsx (1)
CustomConnectWallet(32-204)
apps/dashboard/src/contract-ui/components/solidity-inputs/string-input.tsx (1)
apps/dashboard/src/@3rdweb-sdk/react/hooks/useDashboardStorageUpload.tsx (1)
useDashboardStorageUpload(11-26)
apps/dashboard/src/app/(app)/team/components/TeamHeader/team-header-logged-in.client.tsx (1)
apps/dashboard/src/@3rdweb-sdk/react/components/connect-wallet/index.tsx (1)
CustomConnectWallet(32-204)
apps/dashboard/src/components/contract-components/contract-deploy-form/primary-sale-fieldset.tsx (2)
packages/thirdweb/src/exports/thirdweb.ts (1)
ThirdwebClient(26-26)apps/dashboard/src/contract-ui/components/solidity-inputs/index.tsx (1)
SolidityInput(51-121)
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/ecosystem-header.client.tsx (2)
packages/thirdweb/src/exports/thirdweb.ts (1)
ThirdwebClient(26-26)apps/dashboard/src/@3rdweb-sdk/react/hooks/useDashboardStorageUpload.tsx (1)
useDashboardStorageUpload(11-26)
apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx (2)
apps/dashboard/src/components/contract-components/contract-deploy-form/split-fieldset.tsx (1)
SplitFieldset(22-129)apps/dashboard/src/components/contract-components/contract-deploy-form/trusted-forwarders-fieldset.tsx (1)
TrustedForwardersFieldset(15-60)
apps/dashboard/src/components/contract-components/contract-deploy-form/modular-contract-default-modules-fieldset.tsx (2)
packages/thirdweb/src/exports/thirdweb.ts (1)
ThirdwebClient(26-26)packages/engine/src/client/client.gen.ts (1)
client(24-28)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Graphite / mergeability_check
- GitHub Check: Graphite / mergeability_check
- GitHub Check: Graphite / mergeability_check
- GitHub Check: Graphite / mergeability_check
🔇 Additional comments (57)
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/nfts/[tokenId]/components/transfer-tab.tsx (1)
106-106: LGTM: Client prop correctly added to SolidityInputThe addition of
client={contract.client}properly provides the ThirdwebClient instance to the SolidityInput component, aligning with the refactoring objective to explicitly pass client instances rather than relying on internal hooks.apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/primary-sale.tsx (1)
130-130: LGTM: Consistent client prop implementationThe addition of
client={contract.client}follows the same pattern as other components in this refactor, correctly providing the ThirdwebClient instance to SolidityInput for proper SDK integration.apps/dashboard/src/components/contract-components/contract-publish-form/landing-fieldset.tsx (1)
261-261: LGTM: Client prop correctly passed from hookThe addition of
client={client}properly provides the ThirdwebClient instance obtained from theuseThirdwebClient()hook to the SolidityInput component. This follows the refactoring pattern of explicitly passing the client instance for string input handling.apps/dashboard/src/components/configure-networks/ConfigureNetworkForm.tsx (1)
384-384: LGTM: Client prop added to IconUpload componentThe addition of
client={client}correctly provides the ThirdwebClient instance to the IconUpload component, maintaining consistency with the nearby ChainIconClient component and supporting the refactoring objective to explicitly pass client instances.apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/platform-fees.tsx (1)
132-132: LGTM: Consistent with client prop refactoring patternThe addition of
client={contract.client}prop toSolidityInputcorrectly follows the established pattern of explicitly passing theThirdwebClientinstance instead of relying on internal hooks.apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/tokens/components/transfer-button.tsx (1)
75-75: LGTM: Proper client prop addition for address inputThe
client={contract.client}prop addition ensures theSolidityInputcomponent has access to theThirdwebClientinstance for proper address validation and blockchain interaction.apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client/FaucetButton.tsx (1)
410-410: LGTM: Client prop correctly passed to CustomConnectWalletThe addition of
client={props.client}ensures theCustomConnectWalletcomponent receives the necessaryThirdwebClientinstance for wallet connection functionality, consistent with the refactoring to remove internal hook usage.apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/settings/components/royalties.tsx (1)
144-144: LGTM: Consistent client prop implementationThe
client={contract.client}prop addition toSolidityInputaligns with the broader refactoring effort to explicitly provideThirdwebClientinstances to components that require blockchain interaction capabilities.apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/(marketplace)/components/list-form.tsx (1)
488-488: LGTM! Client prop correctly added to SolidityInput.The change appropriately passes the
clientfrom the contract instance to theSolidityInputcomponent, aligning with the broader architectural refactor to explicitly pass the ThirdwebClient instead of relying on internal hooks.apps/dashboard/src/app/(app)/account/components/AccountHeader.tsx (1)
52-52: LGTM! Client prop correctly added to CustomConnectWallet.The change properly passes the
clientinstance obtained from theuseThirdwebClient()hook to theCustomConnectWalletcomponent, which is required based on the component's updated interface. This aligns with the architectural refactor to explicitly pass the ThirdwebClient instance.apps/dashboard/src/components/contract-components/contract-deploy-form/royalty-fieldset.tsx (1)
5-5: LGTM! Complete client prop integration.The changes systematically update the
RoyaltyFieldsetcomponent to:
- Import the
ThirdwebClienttype- Accept a
clientprop in the component interface- Pass the
clientprop to bothSolidityInputcomponentsThis follows the established pattern across the codebase for explicitly passing the ThirdwebClient instance rather than relying on internal hooks.
Also applies to: 25-25, 47-47, 81-81
apps/dashboard/src/app/(app)/providers.tsx (1)
17-17: LGTM! Client integration for sanctioned addresses checker.The changes properly integrate the ThirdwebClient:
- Import
getClientThirdwebClientfunction- Create a module-level
clientinstance- Pass the
clienttoCustomConnectWalletin the blocked wallet UIThis ensures the sanctioned addresses checker has proper client context and follows the established pattern of explicit client prop passing.
Also applies to: 69-69, 86-90
apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/layout.tsx (2)
75-75: LGTM: Client creation is properly positioned.The client is created at the layout level, which is an appropriate place for centralized client management that can be passed down to child components.
167-167: LGTM: Consistent client prop passing.The client is properly passed to both
ChainHeaderandAddChainToWalletcomponents, maintaining consistency with the refactoring pattern to explicitly provide ThirdwebClient instances rather than relying on internal hooks.Also applies to: 214-214
apps/dashboard/src/app/(app)/team/components/TeamHeader/team-header-logged-in.client.tsx (1)
57-59: LGTM: Client prop properly passed to CustomConnectWallet.The change correctly passes the
clientprop to theCustomConnectWalletcomponent, aligning with the refactoring pattern to explicitly provide ThirdwebClient instances. This improves dependency visibility and component testability.apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/server/chain-header.tsx (3)
4-4: LGTM: Proper type import added.The ThirdwebClient type import is correctly added to support the new client prop.
14-14: LGTM: Props interface properly extended.The ChainHeaderProps type correctly includes the required client prop with proper TypeScript typing.
56-56: LGTM: Client prop properly passed to child component.The client is correctly passed to the AddChainToWallet component, maintaining consistency with the refactoring pattern and ensuring the child component receives the ThirdwebClient instance it requires.
apps/dashboard/src/components/configure-networks/Form/IconUpload.tsx (3)
9-9: LGTM: Proper type import added.The ThirdwebClient type import is correctly added to support the new client prop.
11-14: LGTM: Component signature properly updated.The component props are correctly updated to include the required client prop with proper TypeScript typing. The arrow function syntax with explicit typing provides good type safety.
15-15: LGTM: Hook usage updated to accept explicit client.The useDashboardStorageUpload hook now receives the client explicitly through the options object, which aligns with the refactoring pattern to make dependencies explicit rather than relying on internal hook calls.
apps/dashboard/src/contract-ui/components/solidity-inputs/index.tsx (1)
4-4: LGTM! Proper type addition for client prop.The addition of the
ThirdwebClientimport and theclientprop to both interfaces correctly supports the refactor to explicit client passing. TheSolidityInputcomponent properly forwards this prop to specialized input components via the spread operator.Also applies to: 21-21, 36-36
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/ecosystem-header.client.tsx (1)
169-171: LGTM! Correct implementation of explicit client passing.The storage upload hook correctly uses the explicit
clientprop instead of relying on internal hook calls, which aligns with the PR objectives.apps/dashboard/src/contract-ui/components/solidity-inputs/string-input.tsx (1)
15-15: LGTM! Proper implementation of explicit client prop.The component correctly receives the
clientprop and passes it touseDashboardStorageUpload, following the established pattern for reducinguseThirdwebClienthook usage.Also applies to: 18-18
apps/dashboard/src/components/contract-components/contract-deploy-form/primary-sale-fieldset.tsx (1)
4-4: LGTM! Consistent implementation of client prop pattern.The changes correctly:
- Import the
ThirdwebClienttype- Add the
clientprop to the interface- Pass the
clientprop to theSolidityInputcomponentThis follows the established pattern for the refactor and ensures proper client context propagation.
Also applies to: 11-11, 33-33
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/components/EcosystemSlugLayout.tsx (2)
3-3: LGTM: Import addition supports the dependency injection pattern.The import of
getClientThirdwebClientaligns with the PR objective to reduceuseThirdwebClienthook usage by explicitly passing client instances.
49-49: LGTM: Client prop properly passed to EcosystemHeader.The client instance is correctly passed down to the
EcosystemHeadercomponent, following the dependency injection pattern established in this refactor.apps/dashboard/src/components/contract-components/contract-deploy-form/sequential-token-id-fieldset.tsx (2)
5-5: LGTM: Type import and interface extension are correct.The addition of
ThirdwebClientimport and theclientproperty to theSequentialTokenIdFieldsetPropsinterface follows the established pattern for this refactor.Also applies to: 11-11
26-30: LGTM: Client prop correctly passed to SolidityInput.The
clientprop is properly threaded through to theSolidityInputcomponent, maintaining consistency with the dependency injection pattern being implemented across the codebase.apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/(chainPage)/components/client/add-chain-to-wallet.tsx (2)
9-9: LGTM: Type import and props interface updated correctly.The addition of
ThirdwebClientto the imports and theclientproperty toAddChainToWalletPropsfollows the established pattern for this refactor.Also applies to: 19-19
53-56: LGTM: Client properly passed to customConnectModal.The client is correctly passed to
customConnectModalwhen no account is present, ensuring the connection modal has the proper client context for wallet operations.apps/dashboard/src/components/contract-components/contract-deploy-form/param.tsx (2)
5-5: LGTM: Type import, interface, and component signature updated correctly.The addition of
ThirdwebClientimport, theclientproperty toParamPropsinterface, and the parameter in the component destructuring all follow the established pattern for this refactor.Also applies to: 11-11, 28-28
64-64: LGTM: Client prop correctly passed to SolidityInput.The
clientprop is properly passed to theSolidityInputcomponent, ensuring it has access to the Thirdweb client context for blockchain interactions and input validation.apps/dashboard/src/components/contract-components/contract-publish-form/index.tsx (1)
335-338: LGTM! Proper client prop propagation.The client instance is correctly passed down to child components that require it. This change aligns well with the broader refactoring goal of reducing
useThirdwebClienthook usage in favor of explicit prop passing, improving component testability and reducing coupling.Also applies to: 342-345, 375-378
apps/dashboard/src/app/(app)/drops/[slug]/mint-ui.tsx (1)
101-101: LGTM! Cleaner client usage pattern.Using
props.contract.clientinstead of a localuseThirdwebClient()hook is more explicit and follows the single source of truth principle. This reduces the component's dependencies and improves maintainability.Also applies to: 226-226
apps/dashboard/src/components/contract-components/contract-publish-form/contract-params-fieldset.tsx (1)
15-15: LGTM! Consistent client prop implementation.The changes properly extend the component interface and pass the client down to
SolidityInput. This follows the established pattern for the refactoring and maintains type safety while improving explicit client management.Also applies to: 21-21, 25-25, 221-221
apps/dashboard/src/components/contract-components/contract-deploy-form/trusted-forwarders-fieldset.tsx (1)
3-3: LGTM! Consistent refactoring pattern applied.The changes follow the same clean pattern as other components in this refactor - adding the client prop to the interface and passing it down to
SolidityInput. The implementation is minimal and maintains existing functionality while improving client management consistency.Also applies to: 12-12, 17-17, 50-50
apps/dashboard/src/components/contract-components/contract-deploy-form/platform-fee-fieldset.tsx (1)
5-5: LGTM! Clean implementation of explicit client prop injection.The addition of the
clientprop follows the established pattern for this refactor perfectly. The type import, interface update, parameter destructuring, and prop forwarding toSolidityInputare all correctly implemented.Also applies to: 13-13, 20-20, 51-51
apps/dashboard/src/components/contract-components/contract-deploy-form/split-fieldset.tsx (1)
8-8: Excellent implementation of the client prop pattern.The changes are well-structured and consistent:
- Clean import organization combining
ThirdwebClientwith existing imports- Proper interface extension with the required
clientprop- Correct prop destructuring and forwarding to
SolidityInputAlso applies to: 14-14, 22-25, 55-55
apps/dashboard/src/components/contract-components/contract-publish-form/impl-params-fieldset.tsx (1)
10-10: Perfect adherence to the established refactor pattern.The implementation correctly follows the systematic approach:
- Proper type import for
ThirdwebClient- Interface extension with required
clientprop- Clean parameter destructuring
- Appropriate prop forwarding to
SolidityInputAlso applies to: 15-15, 19-19, 124-124
apps/dashboard/src/@3rdweb-sdk/react/components/connect-wallet/index.tsx (3)
14-14: Excellent refactor removing internal hook dependency.The component now properly receives the
ThirdwebClientinstance as a prop instead of using theuseThirdwebClienthook internally. This improves explicit dependency management and aligns with the broader refactor goals.Also applies to: 38-38, 41-41
144-144: Proper client prop forwarding to child components.The
clientprop is correctly passed to bothConnectButtonandCustomChainRenderercomponents, ensuring consistent client context throughout the component tree.Also applies to: 179-179
282-284: Well-implemented hook parameter update.The
useCustomConnectModalhook correctly requires theclientas a parameter and the dependency array is properly updated to exclude the client since it's now a parameter rather than a captured variable.Also applies to: 302-302
apps/dashboard/src/@3rdweb-sdk/react/hooks/useDashboardStorageUpload.tsx (1)
2-2: LGTM: Clean dependency injection refactorThe changes properly implement explicit client dependency injection:
- Added
ThirdwebClientimport and type annotation- Made
optionsparameter required with the newclientproperty- Eliminated internal hook dependency in favor of explicit parameter passing
This is a clean breaking change that improves testability and dependency management.
Also applies to: 8-8, 11-11
apps/dashboard/src/components/contract-components/contract-deploy-form/modular-contract-default-modules-fieldset.tsx (5)
4-4: LGTM: Proper type import and interface updateThe import of
ThirdwebClientand addition to the component props follows the established pattern for this refactor.Also applies to: 24-24
35-36: LGTM: Consistent client prop propagationThe client prop is correctly passed down to the
RenderModulecomponent and added to its interface, maintaining the chain of dependency injection.Also applies to: 47-47
64-70: LGTM: Systematic client propagation to render functionsAll three render functions (
RenderRoyaltyFieldset,RenderPrimarySaleFieldset,RenderSequentialTokenIdFieldset) correctly receive and pass the client prop to their respective fieldset components.Also applies to: 75-81, 86-92
116-116: LGTM: SolidityInput receives client propThe
SolidityInputcomponent correctly receives the client prop for the generic parameter rendering case.
140-142: LGTM: All specialized render components properly handle client propAll render components (
RenderPrimarySaleFieldset,RenderSequentialTokenIdFieldset,RenderRoyaltyFieldset) correctly:
- Accept the client prop in their interfaces
- Destructure it from props where needed
- Pass it to their respective fieldset components
The prop threading is consistent and follows the established pattern.
Also applies to: 157-158, 166-168, 179-180, 188-188, 202-202
apps/dashboard/src/components/contract-components/contract-deploy-form/custom-contract.tsx (8)
463-463: LGTM: Client prop added to Param componentThe client prop is correctly passed to the
Paramcomponent in the advanced parameters section.
474-480: LGTM: Critical useMemo dependency updateAdding
thirdwebClientto the dependency array is essential for correctness since theParamcomponents now depend on the client prop. This ensures the advanced parameters are properly re-rendered when the client changes.
738-738: LGTM: Client prop added to PrimarySaleFieldset componentsBoth primary sale fieldset instances correctly receive the client prop for their respective form fields (
_saleRecipientand_primarySaleRecipient).Also applies to: 757-757
791-791: LGTM: Client prop added to RoyaltyFieldset and PlatformFeeFieldsetBoth fieldset components correctly receive the client prop for their respective functionality.
Also applies to: 800-800
804-804: LGTM: Client prop added to SplitFieldset and TrustedForwardersFieldsetBoth components properly receive the client prop. The formatting is consistent with the established pattern.
Also applies to: 807-810
833-833: LGTM: Client prop added to all Param componentsAll
Paramcomponents in the rewards section, voting section, and main parameter rendering correctly receive the client prop.Also applies to: 861-861, 904-904
914-914: LGTM: Client prop added to ModularContractDefaultModulesFieldsetThe modular contract fieldset correctly receives the client prop for handling module-specific parameters.
1030-1030: LGTM: Client prop added to SolidityInput for salt inputThe
SolidityInputcomponent for thesaltForCreate2field correctly receives the client prop.
Merge activity
|
<!--
## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"
If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):
## Notes for the reviewer
Anything important to call out? Be sure to also clarify these in your comments.
## How to test
Unit tests, playground, etc.
-->
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on enhancing the functionality of various components by integrating a `client` prop of type `ThirdwebClient` into multiple files. This change improves the interaction with the Thirdweb SDK across the application.
### Detailed summary
- Added `client` prop to components like `IconUpload`, `SolidityInput`, and `CustomConnectWallet`.
- Updated hooks and functions to accept `client` for better SDK integration.
- Modified forms to utilize the `client` for storage uploads and contract deployments.
- Enhanced `AddChainToWallet` and `EcosystemHeader` to support `client`.
- Updated various fieldsets to include `client`, improving data handling and validation.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **New Features**
- Components and forms now consistently accept and require a `client` prop, providing improved client context across wallet connection, contract deployment, network configuration, and NFT interactions.
- **Refactor**
- Updated numerous components and hooks to require explicit passing of the `client` instance, replacing previous internal retrieval methods.
- Prop types and interfaces were extended to include the new `client` property, ensuring consistent usage throughout the app.
- **Bug Fixes**
- Addressed missing `client` props in several components to prevent potential issues with client-dependent functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
4d69067 to
0262763
Compare
6d2fef0 to
a440621
Compare

PR-Codex overview
This PR focuses on integrating the
clientprop of typeThirdwebClientinto various components and hooks across the dashboard application, enhancing their functionality and allowing them to interact with the Thirdweb SDK.Detailed summary
clientprop to components likeIconUpload,SolidityInput, and variousFieldsetcomponents.useDashboardStorageUploadto acceptclientas an argument.CustomConnectWalletto utilize theclientprop.clientfor better SDK integration.clientwhere necessary for improved functionality.Summary by CodeRabbit
New Features
clientprop, providing improved client context across wallet connection, contract deployment, network configuration, and NFT interactions.Refactor
clientinstance, replacing previous internal retrieval methods.clientproperty, ensuring consistent usage throughout the app.Bug Fixes
clientprops in several components to prevent potential issues with client-dependent functionality.