Skip to content

Commit

Permalink
use wallet name in heading when connecting (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
lochie authored Jul 18, 2023
1 parent 72c51fa commit 2d0bec5
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/connectkit/src/components/Common/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
flattenChildren,
isWalletConnectConnector,
isMobile,
isInjectedConnector,
} from '../../../utils';

import {
Expand Down Expand Up @@ -46,6 +47,7 @@ import { AuthIcon } from '../../../assets/icons';
import { useSIWE } from '../../../siwe';
import useLocales from '../../../hooks/useLocales';
import FitText from '../FitText';
import useDefaultWallets from '../../../wallets/useDefaultWallets';

const ProfileIcon = ({ isSignedIn }: { isSignedIn?: boolean }) => (
<div style={{ position: 'relative' }}>
Expand Down Expand Up @@ -207,7 +209,25 @@ const Modal: React.FC<ModalProps> = ({
const mobile = isMobile();
const { isSignedIn, reset } = useSIWE();

const connector = supportedConnectors.find((x) => x.id === context.connector);
const wallets = useDefaultWallets();
const installedWallets = wallets.filter((wallet) => wallet.installed);

let connector = supportedConnectors.find((c) => c.id === context.connector);
if (isInjectedConnector(context.connector)) {
const wallet = installedWallets[0];
connector = {
...wallet,
extensionIsInstalled: () => {
return wallet?.installed;
},
extensions: {
...wallet?.downloadUrls,
},
appUrls: {
...wallet?.downloadUrls,
},
};
}
const locales = useLocales({
CONNECTORNAME: connector?.name,
});
Expand Down

4 comments on commit 2d0bec5

@vercel
Copy link

@vercel vercel bot commented on 2d0bec5 Jul 18, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

connectkit-vite – ./

connectkit-vite-lfe.vercel.app
connectkit-vite-git-main-lfe.vercel.app
connectkit-vite.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 2d0bec5 Jul 18, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

connectkit-cra – ./

connectkit-cra.vercel.app
connectkit-cra-lfe.vercel.app
connectkit-cra-git-main-lfe.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 2d0bec5 Jul 18, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

connectkit-testbench – ./

connectkit-testbench-git-main-lfe.vercel.app
connectkit-testbench.vercel.app
connectkit-testbench-lfe.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 2d0bec5 Jul 18, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

connectkit-nextjs – ./

connectkit-nextjs-git-main-lfe.vercel.app
connectkit-nextjs.vercel.app
connectkit-nextjs-lfe.vercel.app

Please sign in to comment.