Skip to content

Commit

Permalink
spinner configs
Browse files Browse the repository at this point in the history
  • Loading branch information
lochie committed Oct 27, 2023
1 parent a4762cc commit 65edcf4
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import useLocales from '../../../hooks/useLocales';
import { useConnect } from '../../../hooks/useConnect';
import { useContext } from '../../ConnectKit';
import { useWallet } from '../../../hooks/useWallets';
import CircleSpinner from './CircleSpinner';

export const states = {
CONNECTED: 'connected',
Expand Down Expand Up @@ -267,26 +268,51 @@ const ConnectWithInjector: React.FC<{
</RetryButton>
)}
</AnimatePresence>
<SquircleSpinner
logo={
status === states.UNAVAILABLE ? (
<div
style={{
transform: 'scale(1.14)',
position: 'relative',
width: '100%',
}}
>
{wallet.icon}
</div>
) : (
<>{wallet.icon}</>
)
}
//smallLogo={wallet.connector.id === 'injected' && wallet.connector.name === 'injected'}
connecting={status === states.CONNECTING}
//unavailable={status === states.UNAVAILABLE}
/>
{wallet.iconShape === 'circle' ? (
<CircleSpinner
logo={
status === states.UNAVAILABLE ? (
<div
style={{
transform: 'scale(1.14)',
position: 'relative',
width: '100%',
}}
>
{wallet.icon}
</div>
) : (
<>{wallet.icon}</>
)
}
smallLogo={
wallet.id === 'injected' && wallet.connector.id === 'injected'
}
connecting={status === states.CONNECTING}
unavailable={status === states.UNAVAILABLE}
/>
) : (
<SquircleSpinner
logo={
status === states.UNAVAILABLE ? (
<div
style={{
transform: 'scale(1.14)',
position: 'relative',
width: '100%',
}}
>
{wallet.icon}
</div>
) : (
<>{wallet.icon}</>
)
}
//smallLogo={wallet.connector.id === 'injected' && wallet.connector.name === 'injected'}
connecting={status === states.CONNECTING}
//unavailable={status === states.UNAVAILABLE}
/>
)}
{/* </Tooltip> */}
</ConnectingAnimation>
</ConnectingContainer>
Expand Down
2 changes: 2 additions & 0 deletions packages/connectkit/src/constants/walletConfigs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type WalletConfigProps = {
icon?: string | React.ReactNode;
iconConnector?: React.ReactNode;
iconBackground?: string;
iconShape?: 'squircle' | 'circle';
downloadUrls?: { [key: string]: string };
};

Expand Down Expand Up @@ -42,6 +43,7 @@ export const walletConfigs: { [key: string]: WalletConfigProps } = {
),
iconBackground:
'linear-gradient(0deg, var(--ck-brand-metamask-12), var(--ck-brand-metamask-11))',
iconShape: 'circle',
downloadUrls: {
chrome:
'https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn',
Expand Down

0 comments on commit 65edcf4

Please sign in to comment.