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 connect wallet functionality to Swap component #1173

Merged
merged 22 commits into from
Aug 28, 2024

Conversation

abcrane123
Copy link
Contributor

@abcrane123 abcrane123 commented Aug 27, 2024

What changed? Why?

  • if no wallet connected, prompt user to connect wallet after filling out inputs
Screen.Recording.2024-08-27.at.12.17.00.PM.mov

Screenshot 2024-08-28 at 11 22 45 AM

Notes to reviewers

How has it been tested?

Copy link

vercel bot commented Aug 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 Aug 28, 2024 10:10pm
onchainkit-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 10:10pm
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 10:10pm

@@ -53,7 +57,7 @@ export const Wallet = ({ children }: WalletReact) => {

return (
<WalletProvider>
<WalletContent>{children}</WalletContent>
<WalletContent className={className}>{children}</WalletContent>
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@@ -121,6 +131,7 @@ export type SwapButtonReact = {
};

export type SwapContextType = {
address?: Address;
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably we want a line of comment here explain when the address here is used.

@@ -128,7 +142,17 @@ export function SwapProvider({
destination.setLoading(true);
setLifeCycleStatus({
statusName: 'amountChange',
statusData: null,
statusData: {
// when fetching quote, the previous
Copy link
Contributor

Choose a reason for hiding this comment

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

love the comments


const isMissingRequiredFields =
!!statusData &&
'isMissingRequiredField' in statusData &&
Copy link
Contributor

Choose a reason for hiding this comment

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

ok nice

Copy link
Contributor

@Zizzamia Zizzamia left a comment

Choose a reason for hiding this comment

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

Ok, brilliant!!!

I know it's hard to think Life Cycle Status first, but this PR really helps showcase how this can happen.

It's more work for us, but overall keeps all the data layer better organized in one place.

const { chainId } = useContext(AppContext);

console.log('base', base.id);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove

@abcrane123 abcrane123 merged commit 1a25d7d into main Aug 28, 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.

5 participants