Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

feat: add CodeSegment component with enhanced code snippets in ContractFunction #2673

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

jnsdls
Copy link
Member

@jnsdls jnsdls commented Jun 15, 2024

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.



PR-Codex overview

The focus of this PR is to refactor code related to contract function execution and UI components.

Detailed summary

  • Removed unnecessary variables in code-overview.tsx
  • Updated onClick function to handle contract function execution
  • Added CodeSegment component and related functions to display code snippets in ContractFunction component

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Jun 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 15, 2024 4:38am

Copy link

graphite-app bot commented Jun 15, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@jnsdls jnsdls marked this pull request as ready for review June 15, 2024 04:10
@jnsdls jnsdls force-pushed the feat/add-abitype-integration branch from de58cfe to 32f600f Compare June 15, 2024 04:15
@jnsdls jnsdls force-pushed the feat/expand-contract-function-capabilities branch from d69ab15 to 614799b Compare June 15, 2024 04:16
Copy link

graphite-app bot commented Jun 15, 2024

Merge activity

…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 -->
@jnsdls jnsdls force-pushed the feat/add-abitype-integration branch from 32f600f to 4faf636 Compare June 15, 2024 04:28
@jnsdls jnsdls force-pushed the feat/expand-contract-function-capabilities branch from 614799b to 091ecf8 Compare June 15, 2024 04:28
@jnsdls jnsdls changed the base branch from feat/add-abitype-integration to main June 15, 2024 04:39
@graphite-app graphite-app bot merged commit 091ecf8 into main Jun 15, 2024
9 checks passed
@graphite-app graphite-app bot deleted the feat/expand-contract-function-capabilities branch June 15, 2024 04:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants