-
Notifications
You must be signed in to change notification settings - Fork 158
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 isSponsored
prop for Swap
#1293
Conversation
bf91af4
to
00e0e7f
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/swap/components/Swap.tsx
Outdated
@@ -21,6 +21,7 @@ export function Swap({ | |||
onError, | |||
onStatus, | |||
onSuccess, | |||
isSponsored, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could default to false here and not have to handle undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need special handling for undefined since it's falsey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I can add a default here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added in latest diff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still like explicitly defining as false
src/swap/types.ts
Outdated
@@ -267,6 +269,7 @@ export type SwapProviderReact = { | |||
experimental: { | |||
useAggregator: boolean; // Whether to use a DEX aggregator. (default: true) | |||
}; | |||
isSponsored?: boolean; // Whether the swap is sponsored. (default: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: starting the comment description with // An optional...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/swap/types.ts
Outdated
@@ -282,6 +285,7 @@ export type SwapReact = { | |||
experimental?: { | |||
useAggregator: boolean; // Whether to use a DEX aggregator. (default: true) | |||
}; | |||
isSponsored?: boolean; // Whether the swap is sponsored. (default: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: starting the comment description with // An optional...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/swap/components/Swap.tsx
Outdated
@@ -48,6 +49,7 @@ export function Swap({ | |||
onError={onError} | |||
onStatus={onStatus} | |||
onSuccess={onSuccess} | |||
isSponsored={isSponsored} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: alphabetic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done - this was from when we called it sponsored
src/swap/components/Swap.tsx
Outdated
@@ -21,6 +21,7 @@ export function Swap({ | |||
onError, | |||
onStatus, | |||
onSuccess, | |||
isSponsored = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: alphabetic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done - this was from when we called it sponsored
What changed? Why?
isSponsored
propNotes to reviewers
How has it been tested?