Skip to content

fix: pass though logo and name to cb wallet #1808

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 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eight-buttons-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@coinbase/onchainkit': patch
---

***fix***: update wallet modal to pass through app name and logo. By @alessey #1808
11 changes: 6 additions & 5 deletions src/wallet/components/WalletModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,18 @@ export function WalletModal({
};
}, [isOpen, onClose]);

const appLogo = config?.appearance?.logo;
const appName = config?.appearance?.name;
const appLogo = config?.appearance?.logo ?? undefined;
const appName = config?.appearance?.name ?? undefined;
const privacyPolicyUrl = config?.wallet?.privacyUrl ?? undefined;
const termsOfServiceUrl = config?.wallet?.termsUrl ?? undefined;

const handleCoinbaseWalletConnection = useCallback(() => {
try {
const cbConnector = coinbaseWallet({
preference: 'all',
appName,
appLogoUrl: appLogo,
});

connect({ connector: cbConnector });
onClose();
} catch (error) {
Expand All @@ -104,15 +105,15 @@ export function WalletModal({
);
}
}
}, [connect, onClose, onError]);
}, [appName, appLogo, connect, onClose, onError]);

const handleMetaMaskConnection = useCallback(() => {
try {
const metamaskConnector = metaMask({
dappMetadata: {
name: appName || 'OnchainKit App',
url: window.location.origin,
iconUrl: appLogo || undefined,
iconUrl: appLogo,
},
});

Expand Down
Loading