Skip to content

Commit

Permalink
[SDK] Fix: Wallet avatar styles in ConnectButton and Modal (#5422)
Browse files Browse the repository at this point in the history
i just want my cat back

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on updating the styling of the `img` elements in the `DetailsModal` component to ensure they maintain aspect ratio and are responsive.

### Detailed summary
- Changed the `width` of the first `img` to `"100%"` and added `objectFit: "cover"`.
- Updated the second `img` to have `height` and `width` set to `"100%"`, along with `objectFit: "cover"`.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
  • Loading branch information
kien-ngo committed Nov 18, 2024
1 parent d4430d4 commit 510be22
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ export const ConnectedWalletDetails: React.FC<{
alt=""
src={avatarSrc}
style={{
width: "100%",
height: "100%",
width: "100%",
objectFit: "cover",

Check warning on line 229 in packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx#L228-L229

Added lines #L228 - L229 were not covered by tests
}}
/>
) : (
Expand Down Expand Up @@ -410,8 +411,9 @@ function DetailsModal(props: {
<img
src={avatarSrc}
style={{
width: iconSize.xxl,
height: iconSize.xxl,
height: "100%",
width: "100%",
objectFit: "cover",

Check warning on line 416 in packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx#L414-L416

Added lines #L414 - L416 were not covered by tests
}}
alt=""
/>
Expand Down

0 comments on commit 510be22

Please sign in to comment.