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

Merged
merged 5 commits into from
Oct 1, 2024
Merged

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 Oct 1, 2024 2:12pm
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 2:12pm

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

@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.

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 na it is necessary. I don't use pressable.disabled on the actual link because that would make the background color change like this:

Screenshot 2024-10-01 at 6 36 25 AM

So I disable the pointer events on the link to prevent the hover effect from pressable.default which is on the link, and then apply pressable.disabled to the span inside the link so that the text is dimmed to look disabled.

@mindapivessa
Copy link
Contributor

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

@steveviselli-cb
Copy link
Contributor Author

will smart wallet be a part of a different PR?

@mindapivessa nope smart wallet is in this one too. You can see it in the second video.

@0xAlec 0xAlec merged commit c9c7c3e into coinbase:main Oct 1, 2024
10 of 13 checks passed
@steveviselli-cb steveviselli-cb deleted the steve-viselli/fund branch October 1, 2024 20:16
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.

6 participants