-
Notifications
You must be signed in to change notification settings - Fork 199
Update the react-app example to use the wallet plugin #1825
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
4 commits
Select commit
Hold shift + click to select a range
39e475b
Make the type param in useClient non-optional
mcintyre94 ad8b517
Update the react-app example to use the wallet plugin
mcintyre94 fbe55ee
Update to wallet plugin 0.14.0, with client as a param
mcintyre94 64ea156
Refactor: stop gating client update on wallet readiness
mcintyre94 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@solana/react': patch | ||
| --- | ||
|
|
||
| Bump the `@wallet-standard/ui` and `@wallet-standard/ui-registry` dependencies to `^1.0.3` and `^1.1.1` respectively. The `1.1.x` registry line is a backward-compatible superset that continues to export the names `@solana/react` relies on, and aligning with it lets consumers that also pull in `@solana/kit-plugin-wallet` resolve a single, shared copy of the wallet-standard UI registry (which is a runtime singleton) instead of splitting across two incompatible copies. |
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
2 changes: 1 addition & 1 deletion
2
examples/react-app/src/components/BaseSignMessageFeaturePanel.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
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 |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { Box } from '@radix-ui/themes'; | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| type Props = Readonly<{ | ||
| busy: boolean; | ||
| children: ReactNode; | ||
| }>; | ||
|
|
||
| /** | ||
| * Dims its subtree and disables pointer interaction while `busy`. | ||
| * | ||
| * Used to hold wallet-dependent UI on screen during a chain-switch warm-up: the previous account | ||
| * stays visible (via {@link useDisplayedWallet}) but greyed out. The `pointer-events: none` is | ||
| * important — the displayed connection belongs to the previous, disposed client, | ||
| * so it must not be acted on until the new client settles. | ||
| * | ||
| * @param busy - When `true`, dim to 50% and block pointer events; also sets `aria-busy`. | ||
| */ | ||
| export function Dimmable({ busy, children }: Props) { | ||
| return ( | ||
| <Box | ||
| aria-busy={busy} | ||
| style={{ | ||
| opacity: busy ? 0.5 : 1, | ||
| pointerEvents: busy ? 'none' : undefined, | ||
| transition: 'opacity 150ms', | ||
| }} | ||
| > | ||
| {children} | ||
| </Box> | ||
| ); | ||
| } |
Oops, something went wrong.
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.
Flagging this: the previous implementation displayed wallets that cannot be connected to, eg because they don't support the selected chain or don't have the
StandardConnectfeature. The plugin filters wallets to only those that support the selected chain and have theStandardConnectfeature.It is not possible, using only the plugin, to display wallets that have been filtered out. An app could do this by using the wallet-standard libraries directly, as the previous implementation did, but I haven't included that here.
In general I think this is the right default - the app only gets wallets that it can connect to.
Opened an issue in kit-plugins to add the filtered wallets if we want to bring this ability to display them back: anza-xyz/kit-plugins#313