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

feat: add fund button #1322

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

steveviselli-cb
Copy link
Contributor

@steveviselli-cb steveviselli-cb commented Sep 27, 2024

What changed? Why?

  • Implemented the <FundButton /> component integrated with Coinbase Onramp
  • Added <FundButton /> to Playground
  • Fixed the spinner color to match Figma
  • Updated the WalletDropdownFundLink to render a disabled button/link when there's no funding URL

Playground demo with ProjectId is correctly configured:

Onramp.mov

Playground demo with ProjectId is NOT configured:

No.Project.ID.mov

Disabled wallet dropdown button treatment:

Screenshot 2024-09-27 at 12 46 11 PM

Correct spinner color i.e. not blue

Screenshot 2024-09-27 at 2 32 34 PM

Notes to reviewers

How has it been tested?

  • Unit tests
  • Playground

Copy link

vercel bot commented Sep 27, 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 Sep 27, 2024 9:31pm
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2024 9:31pm

Copy link

vercel bot commented Sep 27, 2024

@steveviselli-cb is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@@ -28,7 +28,7 @@ export const pressable = {
secondary:
'cursor-pointer bg-ock-secondary active:bg-ock-secondary-active hover:bg-[var(--bg-ock-secondary-hover)]',
shadow: 'shadow-ock-default',
disabled: 'opacity-[0.38]',
disabled: 'opacity-[0.38] pointer-events-none',
Copy link
Contributor Author

@steveviselli-cb steveviselli-cb Sep 27, 2024

Choose a reason for hiding this comment

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

Removes hover effects for disabled buttons. Confirmed with @mindapivessa.

import type { WalletDropdownFundLinkReact } from '../types';
import { WalletDropdownFundLinkButton } from './WalletDropdownFundLinkButton';

export function WalletDropdownFundLink({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ended up merging this back into a single component, you guys were right @0xAlec @alessey

@@ -13,7 +13,7 @@ export function Spinner({ className }: SpinnerReact) {
<div
className={cn(
'animate-spin border-2 border-gray-200 border-t-3',
'rounded-full border-t-blue-500 px-2.5 py-2.5',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Confirmed with @mindapivessa that this was the wrong color.

@steveviselli-cb steveviselli-cb marked this pull request as ready for review September 27, 2024 21:37
@fakepixels
Copy link
Contributor

Nit - can we increase the sidebar width so smart wallet doesn't become 2 lines? @steveviselli-cb
Screenshot 2024-09-28 at 11 31 32 AM

/**
* Gets the appropriate popup dimensions for the given size and funding URL.
*/
export function getPopupSize(
Copy link
Contributor

Choose a reason for hiding this comment

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

since this is specific to funding, should this be getFundingPopupSize?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alessey Yeah sure I can do that! I figured that having it under /fund would make including fund in the name redundant, but probably better to be explicit.

Copy link
Contributor

Choose a reason for hiding this comment

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

yea, that's true, my brain glossed over the /fund in the url when I first saw it.

@steveviselli-cb
Copy link
Contributor Author

Nit - can we increase the sidebar width so smart wallet doesn't become 2 lines?

@fakepixels that's just because I resized the browser window to be small for the video, it's not normally like that.

const overrideClassName = cn(
pressable.default,
// Disable hover effects if there is no funding URL
!fundingUrlToRender && 'pointer-events-none',
Copy link
Contributor

Choose a reason for hiding this comment

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

@mindapivessa
Copy link
Contributor

@steveviselli-cb will smart wallet be a part of a different PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants