-
Notifications
You must be signed in to change notification settings - Fork 351
feat: add isSponsored prop to Transaction and playground #1499
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
76e0dd7
add isSponsored prop
alissacrane-cb 72f7cdc
fix lint
alissacrane-cb c8d8b64
add test coverage
alissacrane-cb 10c1bd8
fix lint
alissacrane-cb 70e9ccc
add isSponsored to playground
alissacrane-cb 1d9c656
fix lint
alissacrane-cb 96543c9
adjust logic
alissacrane-cb e694d64
move capabilities
alissacrane-cb ea668c1
add isSponsored to swap
alissacrane-cb 30067f6
add deprecated note
alissacrane-cb a8db582
grab paymaster from config for swaps
alissacrane-cb b7458f8
pass paymaster to playground provider
alissacrane-cb 2acae85
update paymaster functionality
alissacrane-cb 27b30e7
fix lint
alissacrane-cb cf18b3c
add test
alissacrane-cb afb167c
fix lint
alissacrane-cb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
playground/nextjs-app-router/components/form/is-sponsored.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Label } from '@/components/ui/label'; | ||
import { Switch } from '@/components/ui/switch'; | ||
import { useCallback, useContext } from 'react'; | ||
import { AppContext } from '../AppProvider'; | ||
|
||
export function IsSponsored() { | ||
const { isSponsored, setIsSponsored } = useContext(AppContext); | ||
|
||
const handleChange = useCallback(() => { | ||
setIsSponsored(!isSponsored); | ||
}, [setIsSpon 10000 sored, isSponsored]); | ||
|
||
return ( | ||
<div className="grid gap-2"> | ||
<div className="flex items-center justify-between"> | ||
<Label htmlFor="sponsored mr-auto">isSponsored</Label> | ||
<div className="flex items-center gap-2"> | ||
<Switch | ||
id="is-sponsored" | ||
checked={isSponsored} | ||
> | ||
/> | ||
<Label htmlFor="is-sponsored text-foregroundMuted">True</Label> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ export function Transaction({ | |
className, | ||
children, | ||
contracts, | ||
isSponsored, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add a |
||
onError, | ||
onStatus, | ||
onSuccess, | ||
|
@@ -35,6 +36,7 @@ export function Transaction({ | |
capabilities={capabilities} | ||
chainId={accountChainId} | ||
contracts={contracts} | ||
isSponsored={isSponsored} | ||
> | ||
> | ||
> | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
can you add this to other relevant components (Swap and Pay)
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.
should Pay have
isSponsored
prop ? isn't it always sponsored by Coinbase? or is this a short term thing ?