Skip to content

Commit

Permalink
Spacing Fixes, Revert color changes (#3107)
Browse files Browse the repository at this point in the history
  • Loading branch information
MananTank committed May 22, 2024
1 parent 10b563c commit 57f7cd5
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 42 deletions.
6 changes: 6 additions & 0 deletions .changeset/shy-pants-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"thirdweb": patch
---

- Fix spacing issues in UI components
- Revert color changes in UI components
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ const WalletSelectorInner: React.FC<WalletSelectorProps> = (props) => {
{tos ? (
<Container p="md"> {tos} </Container>
) : (
<Spacer y="md" />
<Spacer y="xxs" />
)}
</Container>
);
Expand Down Expand Up @@ -459,11 +459,7 @@ const WalletSelectorInner: React.FC<WalletSelectorProps> = (props) => {

{bottomSection}
{isCompact && connectModal.showThirdwebBranding !== false && (
<Container
style={{
paddingBottom: spacing.md,
}}
>
<Container py="md">
<PoweredByThirdweb />
</Container>
)}
Expand Down
14 changes: 2 additions & 12 deletions packages/thirdweb/src/react/web/ui/components/Img.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useState } from "react";
import type { ThirdwebClient } from "../../../../client/client.js";
import { resolveScheme } from "../../../../utils/ipfs.js";
import { Skeleton } from "./Skeleton.js";
import { Container } from "./basic.js";

// Note: Must not use useConnectUI here

Expand All @@ -29,11 +28,7 @@ export const Img: React.FC<{
const heightPx = `${props.height || props.width}px`;

if (propSrc === undefined) {
return (
<Container style={{ margin: "auto" }}>
<Skeleton width={widthPx} height={heightPx} />
</Container>
);
return <Skeleton width={widthPx} height={heightPx} />;
}

const getSrc = () => {
Expand All @@ -59,11 +54,7 @@ export const Img: React.FC<{
justifyItems: "center",
}}
>
{!isLoaded && (
<Container style={{ margin: "auto" }}>
<Skeleton width={widthPx} height={heightPx} />
</Container>
)}
{!isLoaded && <Skeleton width={widthPx} height={heightPx} />}
<img
onLoad={() => {
setIsLoaded(true);
Expand All @@ -76,7 +67,6 @@ export const Img: React.FC<{
loading={props.loading}
decoding="async"
style={{
display: isLoaded ? "block" : "none",
objectFit: "contain",
height: !isLoaded
? 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function TokenIcon(props: {

return (
<Img
src={tokenImage}
src={tokenImage || ""}
width={iconSize[props.size]}
height={iconSize[props.size]}
fallbackImage={genericTokenIcon}
Expand Down
14 changes: 7 additions & 7 deletions packages/thirdweb/src/react/web/ui/design-system/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,32 @@ type ThemeColors = {
};

const darkColors = {
base1: "hsl(228deg 12% 8%)",
base2: "hsl(228deg 12% 12%)",
base3: "hsl(228deg 12% 15%)",
base4: "hsl(228deg 12% 18%)",
base1: "hsl(230deg 11.63% 8.43%)",
base2: "hsl(230deg 11.63% 12%)",
base3: "hsl(230deg 11.63% 15%)",
base4: "hsl(230deg 11.63% 17%)",
primaryText: "#eeeef0",
secondaryText: "#7c7a85",
danger: "#e5484D",
success: "#30A46C",
overlay: "rgba(0, 0, 0, 0.7)",
accentText: "#3385FF",
accentBg: "#3385FF",
accentBg: "hsl(216 100% 50%)",
textOnAccent: "#eeeef0",
} as const satisfies ThemeColors;

const lightColors = {
base1: "#fdfcfd",
base2: "#f2eff3",
base3: "#e3dfe6",
base4: "#e5e6ed",
base4: "#dbd8e0",
primaryText: "#211f26",
secondaryText: "#6f6d78",
accentText: "hsl(216 100% 45%)",
success: "#30A46C",
danger: "#e5484D",
overlay: "rgba(0, 0, 0, 0.7)",
accentBg: "#3385FF",
accentBg: "hsl(216 100% 50%)",
textOnAccent: "#fdfcfd",
} as const satisfies ThemeColors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,26 @@ export const InAppWalletFormUI = (props: InAppWalletFormUIProps) => {
}}
>
{config?.metadata?.image && (
<Img
loading="eager"
client={client}
style={{
maxHeight: "100px",
maxWidth: "300px",
margin: "auto",
}}
src={config.metadata.image.src}
alt={config.metadata.image.alt}
width={Math.min(config.metadata.image.width ?? 300, 300)?.toString()}
height={Math.min(
config.metadata.image.height ?? 100,
100,
)?.toString()}
/>
<Container flex="row" center="both">
<Img
loading="eager"
client={client}
style={{
maxHeight: "100px",
maxWidth: "300px",
}}
src={config.metadata.image.src}
alt={config.metadata.image.alt}
width={Math.min(
config.metadata.image.width ?? 300,
300,
)?.toString()}
height={Math.min(
config.metadata.image.height ?? 100,
100,
)?.toString()}
/>
</Container>
)}

{/* Social Login */}
Expand Down

0 comments on commit 57f7cd5

Please sign in to comment.