This repository has been archived by the owner on Jun 19, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add CodeSegment component with enhanced code snippets in Contra…
…ctFunction (#2673) ### TL;DR Enhances the `ContractFunction` component by adding interactive code snippets for various environments, helping users utilize contract functions in their applications. ### What changed? - Added code snippets under `use this function in your app` section. - Introduced `CodeEnvironment` state to toggle between environments (e.g., JavaScript). - Added import for `CodeSegment`, `COMMANDS`, `formatSnippet`, and `CodeEnvironment`. - Removed console log statements and unused imports. ### How to test? - Verify that code snippets appear as expected for different contract functions. - Toggle between environments and ensure the correct code is displayed. ### Why make this change? Provides developers with ready-to-use code snippets, streamlining the integration process for contract functions into applications. --- <!-- start pr-codex --> --- ## PR-Codex overview The focus of this PR is to refactor code related to contract function execution and UI components in the contract overview tab. ### Detailed summary - Refactored code execution logic for contract functions - Added `CodeSegment` component for displaying code snippets - Updated function usage display in UI based on function type and state mutability > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information