Skip to content

Commit

Permalink
Chore: add walletconnect styling extension points via class names (#85)
Browse files Browse the repository at this point in the history
* chore: add extension points via class names to be able to customize walletconnect

* chore: bump version to 2.3.2
  • Loading branch information
maxlm-devico authored Oct 9, 2024
1 parent edb684a commit 6353efb
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@xdefi/wallets-connector",
"version": "2.3.1",
"version": "2.3.2",
"description": "Cross chain wallets connector with react hooks",
"author": "garageinc",
"license": "MIT",
Expand Down
19 changes: 13 additions & 6 deletions src/components/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,24 @@ export function WalletProvider({

if (needInstall) {
return installationLink ? (
<SLink href={installationLink} target='_blank'>
<SLink
className='walletconnect__provider-row--install-link'
href={installationLink}
target='_blank'
>
<span>Please install {name}</span>
<LinkOutSvg />
</SLink>
) : (
<SLinkFallback>Please install {name}</SLinkFallback>
<SLinkFallback className='walletconnect__provider-row--install-link-fallback'>
Please install {name}
</SLinkFallback>
)
}

if (isRecommended) {
return (
<RecommendedWrapper>
<RecommendedWrapper className='walletconnect__provider-row--recommended'>
<span>Recommended</span>
<ArrowSvg />
</RecommendedWrapper>
Expand Down Expand Up @@ -153,16 +159,17 @@ export function WalletProvider({
onClick={handleClickProvider}
available={isAvailable && !isConnected}
active={isActive}
className='walletconnect__provider-row'
>
<NameWrapper>
<SIcon>
<NameWrapper className='walletconnect__provider-row--name-wrapper'>
<SIcon className='walletconnect__provider-row--icon'>
{typeof El !== 'string' ? (
<El style={{ flexShrink: 0 }} />
) : (
<img src={El} />
)}
</SIcon>
<SName>{name}</SName>
<SName className='walletconnect__provider-row--name'>{name}</SName>
</NameWrapper>
{rightPart}
</SProviderWrapper>
Expand Down
12 changes: 9 additions & 3 deletions src/components/WalletsModal/ChainCard/ChainCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,22 @@ export const ChainCard = ({
}

return (
<Container disabled={disabled} onClick={disabled ? undefined : handleClick}>
<ChainImage>
<Container
className='walletconnect__select-chain--card'
disabled={disabled}
onClick={disabled ? undefined : handleClick}
>
<ChainImage className='walletconnect__select-chain--card-icon-container'>
{icon}
{checked ? (
<CheckmarkWrapper>
<Checkmark />
</CheckmarkWrapper>
) : null}
</ChainImage>
<ChainName>{label}</ChainName>
<ChainName className='walletconnect__select-chain--card-label'>
{label}
</ChainName>
</Container>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const SelectChainSection = ({ provider, onSelect }: IProps) => {

return (
<Container>
<ChainContainer>
<ChainContainer className='walletconnect__select-chain--container'>
{CHAIN_OPTIONS.map((chain) => (
<ChainCard
key={chain.value}
Expand Down
4 changes: 2 additions & 2 deletions src/components/icons/Wallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/providers/logos/ctrl.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/providers/logos/xdefi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6353efb

Please sign in to comment.