Skip to content
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

headerLeftContent in Swap #1752

Merged
merged 2 commits into from
Dec 17, 2024
Merged

headerLeftContent in Swap #1752

merged 2 commits into from
Dec 17, 2024

Conversation

brendan-defi
Copy link
Contributor

What changed? Why?

  • Added a prop to accommodate content on the left-side of the header (for example, to have a back-button)
  • change the title prop from a string to ReactNode to allow for restyling

Notes to reviewers

How has it been tested?
locally, in playground

Copy link

vercel bot commented Dec 17, 2024

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

Name Status Preview Comments Updated (UTC)
onchainkit-coverage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 5:15pm
onchainkit-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 5:15pm
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 17, 2024 5:15pm

@fakepixels
Copy link
Contributor

Thank you!

@@ -298,7 +298,8 @@ export type SwapReact = {
onError?: (error: SwapError) => void; // An optional callback function that handles errors within the provider.
onStatus?: (lifecycleStatus: LifecycleStatus) => void; // An optional callback function that exposes the component lifecycle state
onSuccess?: (transactionReceipt: TransactionReceipt) => void; // An optional callback function that exposes the transaction receipt
title?: string; // Title for the Swap component. (default: "Swap")
title?: ReactNode; // Title for the Swap component. (default: "Swap")
headerLeftContent?: ReactNode; // Header left content for the Swap component (eg. back button).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just call this the backButton? Or make it into a back button sub component?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what other elements are we expecting to be passed through here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was the original change, but we made it more generic to be able to handle things like logos, tray-open/close-buttons, etc.

@brendan-defi brendan-defi merged commit f17fc26 into main Dec 17, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants