Skip to content

Commit 0ca1a79

Browse files
committed
feat: cleanup ui (#4092)
- Reduced border radius on buttons - Reduced connected button size - Removed layout shift between connected and unconnected states - Remove Rainbow from default wallets (replaced with Rabby) https://github.com/user-attachments/assets/334f09d5-46d1-40e3-8b3a-5937771f277c <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on UI cosmetic improvements for wallet-related components. ### Detailed summary - Added `io.rabby` wallet - Adjusted padding and borderRadius in various components - Modified button sizes and styles - Updated wallet image sizes and text styles > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent be344ac commit 0ca1a79

File tree

11 files changed

+46
-35
lines changed

11 files changed

+46
-35
lines changed

.changeset/gold-taxis-count.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
UI cosmetic improvements

apps/playground-web/src/lib/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export const WALLETS = [
3333
}),
3434
createWallet("io.metamask"),
3535
createWallet("com.coinbase.wallet"),
36-
createWallet("me.rainbow"),
3736
createWallet("io.rabby"),
3837
createWallet("com.trustwallet.app"),
3938
];

packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export function ConnectButton(props: ConnectButtonProps) {
290290
const size = useMemo(() => {
291291
return !canFitWideModal() || wallets.length === 1
292292
? "compact"
293-
: props.connectModal?.size || "wide";
293+
: props.connectModal?.size || "compact";
294294
}, [wallets.length, props.connectModal?.size]);
295295

296296
const autoConnectComp = props.autoConnect !== false && (
@@ -318,7 +318,8 @@ export function ConnectButton(props: ConnectButtonProps) {
318318
variant="primary"
319319
type="button"
320320
style={{
321-
minWidth: "140px",
321+
minWidth: "150px",
322+
minHeight: "52px",
322323
...props.connectButton?.style,
323324
}}
324325
>
@@ -419,7 +420,9 @@ function ConnectButtonInner(
419420
variant="primary"
420421
type="button"
421422
style={{
422-
minWidth: "140px",
423+
minWidth: "150px",
424+
minHeight: "52px",
425+
fontSize: "16px",
423426
...props.connectButton?.style,
424427
}}
425428
aria-label={
@@ -456,7 +459,8 @@ function ConnectButtonInner(
456459
variant="primary"
457460
type="button"
458461
style={{
459-
minWidth: "140px",
462+
minWidth: "150px",
463+
minHeight: "52px",
460464
...props.connectButton?.style,
461465
}}
462466
>
@@ -476,7 +480,8 @@ function ConnectButtonInner(
476480
}}
477481
className={props.signInButton?.className}
478482
style={{
479-
minWidth: "140px",
483+
minWidth: "150px",
484+
minHeight: "52px",
480485
...props.signInButton?.style,
481486
}}
482487
>

packages/thirdweb/src/react/web/ui/ConnectWallet/Details.tsx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,33 +196,33 @@ export const ConnectedWalletDetails: React.FC<{
196196
{ensAvatarQuery.data ? (
197197
<Img
198198
src={ensAvatarQuery.data}
199-
width={iconSize.lg}
200-
height={iconSize.lg}
199+
width={iconSize.sm}
200+
height={iconSize.sm}
201201
style={{
202-
borderRadius: radius.sm,
202+
borderRadius: radius.xs,
203203
}}
204204
client={client}
205205
/>
206206
) : activeWallet?.id ? (
207-
<WalletImage size={iconSize.lg} id={activeWallet.id} client={client} />
207+
<WalletImage size={iconSize.md} id={activeWallet.id} client={client} />
208208
) : (
209-
<GenericWalletIcon size={iconSize.lg} />
209+
<GenericWalletIcon size={iconSize.md} />
210210
)}
211211

212-
<Container flex="column" gap="xxs">
212+
<Container flex="column" gap="3xs">
213213
{/* Address */}
214214

215215
{addressOrENS ? (
216216
<Text
217-
size="sm"
217+
size="xs"
218218
color="primaryText"
219219
weight={500}
220220
className={`${TW_CONNECTED_WALLET}__address`}
221221
>
222222
{addressOrENS}
223223
</Text>
224224
) : (
225-
<Skeleton height={fontSize.sm} width="88px" />
225+
<Skeleton height={fontSize.sm} width="80px" />
226226
)}
227227

228228
{/* Balance */}
@@ -236,7 +236,7 @@ export const ConnectedWalletDetails: React.FC<{
236236
{balanceQuery.data.symbol}
237237
</Text>
238238
) : (
239-
<Skeleton height={fontSize.xs} width="82px" />
239+
<Skeleton height={fontSize.xs} width="70px" />
240240
)}
241241
</Container>
242242
</WalletInfoButton>
@@ -886,20 +886,21 @@ const WalletInfoButton = /* @__PURE__ */ StyledButton((_) => {
886886
all: "unset",
887887
background: theme.colors.connectedButtonBg,
888888
border: `1px solid ${theme.colors.borderColor}`,
889-
padding: `${spacing.sm} ${spacing.sm}`,
890-
borderRadius: radius.lg,
889+
padding: `${spacing.xs} ${spacing.sm}`,
890+
borderRadius: radius.md,
891891
cursor: "pointer",
892892
display: "inline-flex",
893893
alignItems: "center",
894-
minWidth: "180px",
895-
gap: spacing.sm,
894+
minWidth: "150px",
895+
minHeight: "52px",
896+
gap: spacing.xs,
896897
boxSizing: "border-box",
897898
WebkitTapHighlightColor: "transparent",
898899
lineHeight: "normal",
899900
animation: `${fadeInAnimation} 300ms ease`,
900901
[media.mobile]: {
901902
gap: spacing.sm,
902-
padding: `${spacing.xs} ${spacing.sm}`,
903+
padding: `${spacing.xs} ${spacing.xs}`,
903904
img: {
904905
width: `${iconSize.md}px`,
905906
height: `${iconSize.md}px`,

packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function AllWalletsUI(props: {
8989

9090
<Input
9191
style={{
92-
padding: `${spacing.sm} ${spacing.md} ${spacing.sm} ${spacing.xxl}`,
92+
padding: `${spacing.sm} ${spacing.sm} ${spacing.sm} ${spacing.xxl}`,
9393
}}
9494
tabIndex={-1}
9595
variant="outline"

packages/thirdweb/src/react/web/ui/ConnectWallet/WalletTypeRowButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ export function WalletTypeRowButton(props: WalletTypeRowProps) {
2424
style={{
2525
display: "flex",
2626
justifyContent: "flex-start",
27-
padding: spacing.md,
27+
padding: spacing.sm,
2828
}}
2929
onClick={() => {
3030
props.onClick();
3131
}}
3232
>
33-
<Container flex="row" gap="md" center="y" color="accentText">
33+
<Container flex="row" gap="sm" center="y" color="accentText">
3434
<Img
3535
client={props.client}
3636
src={props.icon}

packages/thirdweb/src/react/web/ui/components/Modal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const DialogContent = /* @__PURE__ */ StyledDiv((_) => {
171171
background: theme.colors.modalBg,
172172
"--bg": theme.colors.modalBg,
173173
color: theme.colors.primaryText,
174-
borderRadius: radius.xl,
174+
borderRadius: radius.lg,
175175
position: "fixed",
176176
top: "50%",
177177
left: "50%",
@@ -196,7 +196,7 @@ const DialogContent = /* @__PURE__ */ StyledDiv((_) => {
196196
transform: "none",
197197
width: "100vw",
198198
animation: `${modalAnimationMobile} 0.35s cubic-bezier(0.15, 1.15, 0.6, 1)`,
199-
borderRadius: radius.xxl,
199+
borderRadius: radius.xl,
200200
borderBottomRightRadius: 0,
201201
borderBottomLeftRadius: 0,
202202
maxWidth: "none !important",

packages/thirdweb/src/react/web/ui/components/buttons.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export const Button = /* @__PURE__ */ StyledButton((props: ButtonProps) => {
2727
display: "inline-flex",
2828
alignItems: "center",
2929
justifyContent: "center",
30-
borderRadius: radius.lg,
30+
borderRadius: radius.md,
3131
padding: `${fontSize.sm} ${fontSize.sm}`,
32-
fontSize: fontSize.md,
32+
fontSize: fontSize.sm,
3333
fontWeight: 500,
3434
boxSizing: "border-box",
3535
WebkitTapHighlightColor: "transparent",
@@ -90,7 +90,7 @@ export const Button = /* @__PURE__ */ StyledButton((props: ButtonProps) => {
9090
...(() => {
9191
if (props.variant === "outline") {
9292
return {
93-
border: `1.5px solid ${theme.colors.borderColor}`,
93+
border: `1px solid ${theme.colors.borderColor}`,
9494
"&:hover": {
9595
borderColor: theme.colors.accentText,
9696
},
@@ -102,7 +102,7 @@ export const Button = /* @__PURE__ */ StyledButton((props: ButtonProps) => {
102102

103103
if (props.variant === "ghost") {
104104
return {
105-
border: "1.5px solid transparent",
105+
border: "1px solid transparent",
106106
"&:hover": {
107107
borderColor: theme.colors.accentText,
108108
},

packages/thirdweb/src/react/web/ui/components/formElements.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const Input = /* @__PURE__ */ StyledInput<InputProps>((props) => {
4343
width: "100%",
4444
outline: "none",
4545
border: "none",
46-
borderRadius: radius.lg,
46+
borderRadius: radius.md,
4747
color: theme.colors.primaryText,
4848
WebkitAppearance: "none",
4949
appearance: "none",
@@ -109,7 +109,7 @@ export const InputContainer = /* @__PURE__ */ StyledDiv(() => {
109109
const theme = useCustomTheme();
110110
return {
111111
display: "flex",
112-
borderRadius: radius.lg,
112+
borderRadius: radius.md,
113113
boxShadow: `0 0 0px 1.5px ${theme.colors.borderColor}`,
114114
"&:focus-within": {
115115
boxShadow: `0 0 0px 2px ${theme.colors.accentText}`,

packages/thirdweb/src/react/web/wallets/defaultWallets.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export function getDefaultWallets(options?: {
2424
chains: options?.chains,
2525
}),
2626
createWallet(RAINBOW),
27+
createWallet("io.rabby"),
2728
createWallet(ZERION),
2829
];
2930
}

0 commit comments

Comments
 (0)